# Generated by Django 4.0.2 on 2022-02-17 08:22

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('age', models.IntegerField()),
                ('country', models.CharField(choices=[('Poland', 'Poland'), ('Germany', 'Germany'), ('UK', 'UK')], max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Library',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('address', models.CharField(max_length=50)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='PublishingHouse',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('year_of_foundation', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(choices=[('Drama', 'Drama'), ('Poem', 'Poem'), ('Adventure', 'Adventure'), ('Criminal', 'Criminal'), ('Biography', 'Biography')], max_length=20)),
                ('title', models.CharField(blank=True, default='', max_length=200)),
                ('pages', models.IntegerField()),
                ('description', models.CharField(blank=True, default='', max_length=300)),
                ('release_date', models.DateTimeField(auto_now_add=True)),
                ('is_borrowed', models.BooleanField(default=False)),
                ('created_by', models.CharField(blank=True, default='', max_length=100)),
                ('updated_by', models.CharField(blank=True, default='', max_length=100)),
                ('rating', models.FloatField(default=5.0)),
                ('author', models.ManyToManyField(related_name='books', to='book.Author')),
                ('library', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='books', to='book.library')),
                ('publishinghouse', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='books', to='book.publishinghouse')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='books', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['id'],
            },
        ),
    ]
