# Generated by Django 2.0.7 on 2018-07-24 19:09

from django.db import migrations, models
import django.db.models.deletion
import music_publisher.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='AlbumCD',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cd_identifier', models.CharField(blank=True, help_text='This will set the purpose to Library.', max_length=15, null=True, unique=True, validators=[music_publisher.models.CWRFieldValidator('cd_identifier')], verbose_name='CD Identifier')),
                ('release_date', models.DateField(blank=True, help_text='Can be overridden by recording data.', null=True)),
                ('album_title', models.CharField(blank=True, help_text='This will set the label.', max_length=60, null=True, unique=True, validators=[music_publisher.models.CWRFieldValidator('first_album_title')])),
                ('ean', models.CharField(blank=True, max_length=13, null=True, unique=True, validators=[music_publisher.models.CWRFieldValidator('ean')], verbose_name='EAN')),
            ],
            options={
                'abstract': False,
                'verbose_name_plural': 'Albums and Library CDs',
                'verbose_name': 'Album and/or Library CD',
            },
        ),
        migrations.CreateModel(
            name='AlternateTitle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(db_index=True, max_length=60, validators=[music_publisher.models.CWRFieldValidator('work_title')])),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Artist',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=30, validators=[music_publisher.models.CWRFieldValidator('artist_first_name')])),
                ('last_name', models.CharField(db_index=True, max_length=45, validators=[music_publisher.models.CWRFieldValidator('artist_last_name')])),
            ],
            options={
                'verbose_name_plural': 'Performing Artists',
                'verbose_name': 'Performing Artist',
            },
        ),
        migrations.CreateModel(
            name='ArtistInWork',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('artist', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='music_publisher.Artist')),
            ],
            options={
                'verbose_name_plural': 'Artists Performing Work',
                'verbose_name': 'Artist Performing Work',
            },
        ),
        migrations.CreateModel(
            name='FirstRecording',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('isrc', models.CharField(blank=True, max_length=15, null=True, unique=True, validators=[music_publisher.models.CWRFieldValidator('isrc')], verbose_name='ISRC')),
                ('release_date', models.DateField(blank=True, null=True)),
                ('duration', models.TimeField(blank=True, null=True)),
                ('catalog_number', models.CharField(blank=True, max_length=18, null=True, unique=True, validators=[music_publisher.models.CWRFieldValidator('first_release_catalog_number')])),
                ('album_cd', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='music_publisher.AlbumCD', verbose_name='Album / Library CD')),
            ],
            options={
                'abstract': False,
                'verbose_name_plural': 'First recording of the work',
            },
        ),
        migrations.CreateModel(
            name='Work',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(db_index=True, max_length=60, validators=[music_publisher.models.CWRFieldValidator('work_title')])),
                ('iswc', models.CharField(blank=True, max_length=15, null=True, unique=True, validators=[music_publisher.models.CWRFieldValidator('iswc')], verbose_name='ISWC')),
                ('last_change', models.DateTimeField(editable=False, null=True)),
                ('artists', models.ManyToManyField(through='music_publisher.ArtistInWork', to='music_publisher.Artist')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Writer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=30, validators=[music_publisher.models.CWRFieldValidator('artist_first_name')])),
                ('last_name', models.CharField(db_index=True, max_length=45, validators=[music_publisher.models.CWRFieldValidator('artist_last_name')])),
                ('ipi_name', models.CharField(blank=True, max_length=11, null=True, unique=True, validators=[music_publisher.models.CWRFieldValidator('writer_ipi_name')], verbose_name='IPI Name #')),
                ('ipi_base', models.CharField(blank=True, max_length=15, null=True, validators=[music_publisher.models.CWRFieldValidator('writer_ipi_base')], verbose_name='IPI Base #')),
                ('pr_society', models.CharField(blank=True, choices=[('101', 'SOCAN, Canada'), ('088', 'CMRRA, Canada'), ('058', 'SACEM, France'), ('068', 'SDRM, France'), ('035', 'GEMA, Germany'), ('074', 'SIAE, Italy'), ('052', 'PRS, United Kingdom'), ('044', 'MCPS, United Kingdom'), ('010', 'ASCAP, United States'), ('021', 'BMI, United States'), ('071', 'SESAC Inc., United States'), ('034', 'HFA, United States')], max_length=3, null=True, validators=[music_publisher.models.CWRFieldValidator('writer_pr_society')], verbose_name='Performing Rights Society')),
                ('saan', models.CharField(blank=True, help_text='Use this field for general agreements only.', max_length=14, null=True, unique=True, validators=[music_publisher.models.CWRFieldValidator('saan')], verbose_name='Society-assigned agreement number')),
                ('_can_be_controlled', models.BooleanField(default=False, editable=False)),
                ('generally_controlled', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
                'ordering': ('last_name', 'first_name', 'ipi_name'),
            },
        ),
        migrations.CreateModel(
            name='WriterInWork',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('saan', models.CharField(blank=True, help_text='Use this field for specific agreements only.', max_length=14, null=True, validators=[music_publisher.models.CWRFieldValidator('saan')], verbose_name='Society-assigned agreement number')),
                ('controlled', models.BooleanField(default=False)),
                ('relative_share', models.DecimalField(decimal_places=2, max_digits=5)),
                ('capacity', models.CharField(blank=True, choices=[('C ', 'Composer'), ('A ', 'Lyricist'), ('CA', 'Composer&Lyricist')], max_length=2)),
                ('work', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='music_publisher.Work')),
                ('writer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='music_publisher.Writer')),
            ],
        ),
        migrations.AddField(
            model_name='work',
            name='writers',
            field=models.ManyToManyField(through='music_publisher.WriterInWork', to='music_publisher.Writer'),
        ),
        migrations.AddField(
            model_name='firstrecording',
            name='work',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='music_publisher.Work'),
        ),
        migrations.AddField(
            model_name='artistinwork',
            name='work',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='music_publisher.Work'),
        ),
        migrations.AddField(
            model_name='alternatetitle',
            name='work',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='music_publisher.Work'),
        ),
    ]
