# Generated by Django 2.2.17 on 2020-12-20 04:31

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


class Migration(migrations.Migration):

    dependencies = [
        ('library', '0006_auto_20170531_0210'),
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=48)),
                ('isocode', models.CharField(max_length=3)),
            ],
            options={
                'verbose_name_plural': 'Countries',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Genre',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(max_length=32)),
                ('comments', models.TextField(blank=True, null=True)),
            ],
            options={
                'verbose_name_plural': 'Genres',
                'ordering': ['label'],
            },
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(max_length=200)),
                ('description', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.AlterModelOptions(
            name='entry',
            options={'ordering': ['title', 'composer__surname'], 'permissions': [('march_only', 'Can only see marches.')], 'verbose_name_plural': 'Entries'},
        ),
        migrations.AddField(
            model_name='author',
            name='bornyear',
            field=models.IntegerField(blank=True, null=True, verbose_name='Year of Birth'),
        ),
        migrations.AddField(
            model_name='author',
            name='comments',
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='author',
            name='diedyear',
            field=models.IntegerField(blank=True, null=True, verbose_name='Year of Death'),
        ),
        migrations.AddField(
            model_name='entry',
            name='callno',
            field=library.models.LabelField(db_column='label', default='1', max_length=12, verbose_name='label'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='entry',
            name='digitised',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='entry',
            name='provider',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='donations', to='library.Author'),
        ),
        migrations.AddField(
            model_name='entry',
            name='publication',
            field=models.IntegerField(blank=True, help_text='If year not known, use (e.g.) 1920 for all twenties', null=True, verbose_name='Year of this edition'),
        ),
        migrations.AlterField(
            model_name='entry',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='library.Category', verbose_name='Shelving Category'),
        ),
        migrations.AlterField(
            model_name='entry',
            name='instrument',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='library.Instrument'),
        ),
        migrations.AlterField(
            model_name='entry',
            name='media',
            field=models.FileField(blank=True, max_length=256, null=True, upload_to=''),
        ),
        migrations.RemoveField(
            model_name='program',
            name='entry',
        ),
        migrations.AddField(
            model_name='program',
            name='entry',
            field=models.ManyToManyField(related_name='programmed', to='library.Entry'),
        ),
        migrations.AlterUniqueTogether(
            name='entry',
            unique_together=set(),
        ),
        migrations.CreateModel(
            name='Publisher',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('comments', models.TextField(blank=True, null=True)),
                ('country', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='publishers', to='library.Country')),
            ],
            options={
                'ordering': ['name'],
                'unique_together': {('name', 'country')},
            },
        ),
        migrations.RemoveField(
            model_name='entry',
            name='label',
        ),
        migrations.AddField(
            model_name='author',
            name='country',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='authors', to='library.Country'),
        ),
        migrations.AddField(
            model_name='entry',
            name='genre',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='library.Genre', verbose_name='Type/Genre of Work'),
        ),
        migrations.AddField(
            model_name='entry',
            name='publisher',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='publications', to='library.Publisher'),
        ),
        migrations.AddField(
            model_name='entry',
            name='source',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='library.Source'),
        ),
    ]
