# Generated by Django 2.2.17 on 2020-12-27 04:23

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


class Migration(migrations.Migration):

    dependencies = [
        ('library', '0007_auto_20201220_1531'),
    ]

    operations = [
        migrations.CreateModel(
            name='Condition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=48)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.RenameField(
            model_name='entry',
            old_name='publication',
            new_name='pubyear',
        ),
        migrations.AddField(
            model_name='entry',
            name='backpage',
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='entry',
            name='pagecount',
            field=models.IntegerField(blank=True, null=True, verbose_name='Page count'),
        ),
        migrations.AddField(
            model_name='entry',
            name='platecode',
            field=models.CharField(blank=True, max_length=12, null=True),
        ),
        migrations.AddField(
            model_name='entry',
            name='pubissue',
            field=models.CharField(blank=True, max_length=24, null=True),
        ),
        migrations.AlterField(
            model_name='entry',
            name='publisher',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pubyears', to='library.Publisher'),
        ),
        migrations.CreateModel(
            name='Publication',
            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)),
                ('publisher', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='publications', to='library.Publisher')),
            ],
            options={
                'ordering': ['name'],
                'unique_together': {('name', 'publisher')},
            },
        ),
        migrations.AddField(
            model_name='entry',
            name='condition',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='library.Condition'),
        ),
        migrations.AddField(
            model_name='entry',
            name='pubname',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='publications', to='library.Publication'),
        ),
    ]
