# Generated by Django 2.2.15 on 2020-10-14 12:37
from typing import List

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


class Migration(migrations.Migration):

    initial = True

    dependencies: List[str] = []

    operations = [
        migrations.CreateModel(
            name="Author",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("first_name", models.CharField(max_length=100)),
                ("last_name", models.CharField(max_length=100)),
                ("date_of_birth", models.DateField(blank=True, null=True)),
                (
                    "date_of_death",
                    models.DateField(blank=True, null=True, verbose_name="Died"),
                ),
            ],
            options={
                "ordering": ("last_name", "first_name"),
            },
        ),
        migrations.CreateModel(
            name="Genre",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text="Enter a book genre (e.g. Science Fiction)",
                        max_length=200,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Book",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=200)),
                (
                    "summary",
                    models.TextField(
                        help_text="Enter a brief description of the book",
                        max_length=1000,
                    ),
                ),
                (
                    "isbn",
                    models.CharField(
                        help_text='13 Character <a href="https://www.isbn-international.org/content/what-isbn">ISBN number</a>',
                        max_length=13,
                        verbose_name="ISBN",
                    ),
                ),
                ("published_on", models.DateField()),
                (
                    "author",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="books.Author",
                    ),
                ),
                (
                    "genre",
                    models.ManyToManyField(help_text="Select a genre for this book", to="books.Genre"),
                ),
            ],
        ),
    ]
