# Generated by Django 3.0 on 2020-02-11 18:11

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_name', models.CharField(max_length=255, verbose_name='Прізвище')),
                ('first_name', models.CharField(max_length=255, verbose_name="Ім'я")),
                ('patronymic', models.CharField(blank=True, max_length=255, verbose_name='По батькові')),
                ('description', models.TextField(blank=True, verbose_name='Опис')),
                ('image', models.ImageField(blank=True, upload_to=library.utilites.get_timestamp_path_book_author, verbose_name='Зображення')),
            ],
            options={
                'verbose_name': 'Розділ',
                'verbose_name_plural': 'Розділи',
                'ordering': ['last_name'],
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=255, verbose_name='Категорія')),
                ('description', models.TextField(blank=True, verbose_name='Опис категорії')),
            ],
            options={
                'verbose_name': 'Категорія',
                'verbose_name_plural': 'Категорії',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='PublishingHouse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=255, verbose_name='Видавництво')),
                ('description', models.TextField(blank=True, verbose_name='Опис видавництва')),
            ],
            options={
                'verbose_name': 'Видавництво',
                'verbose_name_plural': 'Видавництва',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='SectionCategoy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=255, verbose_name='Розділ')),
                ('description', models.TextField(blank=True, verbose_name='Опис розділу')),
                ('category', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, to='library.Category', verbose_name='Категорія')),
            ],
            options={
                'verbose_name': 'Розділ',
                'verbose_name_plural': 'Розділи',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Видавництво')),
                ('file', models.FileField(blank=True, upload_to=library.utilites.get_timestamp_path_book, verbose_name='Файл Правил')),
                ('cover', models.ImageField(blank=True, upload_to=library.utilites.get_timestamp_path_cover, verbose_name='Обкладинка')),
                ('year', models.PositiveSmallIntegerField(blank=True, default=2020, verbose_name='Дата видання')),
                ('book_author', models.ManyToManyField(blank=True, related_name='author', to='library.Author')),
                ('category', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, to='library.Category', verbose_name='Категорія')),
                ('publishing_house', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, to='library.PublishingHouse', verbose_name='Видавництво')),
                ('section_categoy', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, to='library.SectionCategoy', verbose_name='Рубріка')),
            ],
            options={
                'verbose_name': 'Підручник або кника',
                'verbose_name_plural': 'Підручники або книги',
                'ordering': ['name'],
            },
        ),
    ]
