# Generated by Django 3.2 on 2021-04-12 17:30

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True, verbose_name='Category name')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Nation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='State name')),
                ('abbr', models.CharField(max_length=5, unique=True, verbose_name='State abbreviation')),
                ('flag', models.ImageField(blank=True, null=True, upload_to=inventions.models.flag_path, verbose_name='Flag')),
                ('form_of_state', models.CharField(choices=[('MONARCHY', 'Monarchy'), ('REPUBLIC', 'Republic'), ('THEOCRACY', 'Theocracy')], default='REPUBLIC', max_length=15)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Inventor',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=50, verbose_name='First name')),
                ('last_name', models.CharField(max_length=50, verbose_name='Last name')),
                ('birthday', models.DateField(blank=True, help_text='<em>YYYY-MM-DD</em>', null=True, verbose_name='Birthday')),
                ('date_of_death', models.DateField(blank=True, help_text='<em>YYYY-MM-DD</em>', null=True, verbose_name='Date of death')),
                ('biography', models.TextField(blank=True, null=True, verbose_name='Biography')),
                ('photo', models.ImageField(blank=True, null=True, upload_to=inventions.models.inventor_photo_path, verbose_name='Photo of the inventor')),
                ('nation_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventions.nation')),
            ],
            options={
                'ordering': ['last_name', 'first_name'],
            },
        ),
        migrations.CreateModel(
            name='Invention',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='Invention name')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Description')),
                ('date_of_invention', models.DateField(blank=True, help_text='<em>YYYY-MM-DD</em>', null=True, verbose_name='Date of the invention')),
                ('photo', models.ImageField(blank=True, null=True, upload_to=inventions.models.invention_photo_path, verbose_name='Photo of the invention')),
                ('category', models.ManyToManyField(help_text='Select invention categories', to='inventions.Category')),
                ('inventors', models.ManyToManyField(help_text='Select who invented it', to='inventions.Inventor')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
    ]
