# Generated by Django 3.0.4 on 2020-07-02 16:50

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Newspaper',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('npName', models.CharField(max_length=50, verbose_name='Название газеты')),
                ('npEditorName', models.CharField(max_length=100, verbose_name='ФИО редактора')),
                ('npEditionIndex', models.IntegerField(verbose_name='Индекс издания')),
                ('npPrice', models.PositiveIntegerField(verbose_name='Цена экземпляра')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('oNpCount', models.IntegerField(verbose_name='Количество экземпляров')),
                ('oNpCode', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Newspaper')),
            ],
        ),
        migrations.CreateModel(
            name='PostOffice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('poNum', models.PositiveIntegerField(verbose_name='Номер почтового отделения')),
                ('poAddress', models.CharField(max_length=500, verbose_name='Адрес почтового отделения')),
            ],
        ),
        migrations.CreateModel(
            name='PrintingHouse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phName', models.CharField(max_length=50, verbose_name='Название типографии')),
                ('phAddress', models.CharField(max_length=500, verbose_name='Адрес типографии')),
                ('phWorkStatus', models.CharField(choices=[('открыта', 'открыта'), ('закрыта', 'закрыта')], max_length=100, verbose_name='Статус')),
            ],
        ),
        migrations.CreateModel(
            name='PrintRun',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('prPrintRun', models.PositiveIntegerField(verbose_name='Тираж')),
                ('prNpCode', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Newspaper')),
                ('prOCode', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Order')),
                ('prPhCode', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.PrintingHouse')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='oPoCode',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.PostOffice'),
        ),
    ]
