# Generated by Django 3.0.6 on 2020-05-30 14:04

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='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=300)),
                ('journal', models.CharField(max_length=300)),
                ('impact_factor', models.PositiveSmallIntegerField(default=1)),
                ('volume', models.PositiveSmallIntegerField(default=1)),
                ('article_number', models.PositiveSmallIntegerField(default=1)),
                ('pages', models.CharField(max_length=20)),
                ('publishing_year', models.DateField()),
                ('doi', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('author_name', models.CharField(max_length=100)),
                ('author_surname', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='FictionBook',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=300)),
                ('work_author', models.ManyToManyField(related_name='fiction_book_authors', to='accounting.Author')),
            ],
        ),
        migrations.CreateModel(
            name='LibraryUnit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('unit_available', models.BooleanField(default=True)),
                ('article_unit_type', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounting.Article')),
                ('fiction_book_unit_type', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounting.FictionBook')),
            ],
        ),
        migrations.CreateModel(
            name='LibraryUserAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('building_number', models.PositiveSmallIntegerField()),
                ('apartment_number', models.PositiveSmallIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='UnitStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_issue', models.DateTimeField()),
                ('date_return_nominal', models.DateTimeField()),
                ('date_return_actual', models.DateTimeField()),
                ('library_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounting.LibraryUnit')),
                ('library_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='StreetsList',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('street_name', models.CharField(max_length=200)),
                ('street_info', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounting.LibraryUserAddress')),
            ],
        ),
        migrations.CreateModel(
            name='ScienceBook',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=300)),
                ('publisher', models.CharField(max_length=200)),
                ('edition', models.PositiveSmallIntegerField(default=1)),
                ('publishing_year', models.DateField()),
                ('isbn', models.CharField(max_length=200)),
                ('work_author', models.ManyToManyField(related_name='science_book_authors', to='accounting.Author')),
            ],
        ),
        migrations.CreateModel(
            name='LibraryUserInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone_number', models.PositiveIntegerField()),
                ('library_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='libraryuseraddress',
            name='library_user_info',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounting.LibraryUserInfo'),
        ),
        migrations.AddField(
            model_name='libraryunit',
            name='science_book_unit_type',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounting.ScienceBook'),
        ),
        migrations.CreateModel(
            name='CitiesList',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('city_name', models.CharField(max_length=200)),
                ('city_info', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounting.LibraryUserAddress')),
            ],
        ),
        migrations.AddField(
            model_name='article',
            name='work_author',
            field=models.ManyToManyField(related_name='article_authors', to='accounting.Author'),
        ),
    ]
