# Generated by Django 2.2.7 on 2019-11-17 04:48

import django.utils.timezone
from django.db import migrations, models

import isc_common.fields.code_field
import isc_common.fields.description_field
import isc_common.fields.name_field
import isc_common.fields.related


class Migration(migrations.Migration):

    dependencies = [
        ('kd', '0085_auto_20191031_1745'),
        ('ckk', '0158_delete_status'),
        ('sales', '0112_auto_20191117_0448'),
        ('production', '0086_operations_item_description'),
    ]

    operations = [
        migrations.CreateModel(
            name='Launches',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False, verbose_name='Идентификатор')),
                ('deleted_at', models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='Дата мягкого удаления')),
                ('editing', models.BooleanField(default=True, verbose_name='Возможность редактирования')),
                ('deliting', models.BooleanField(default=True, verbose_name='Возможность удаления')),
                ('lastmodified', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='Последнее обновление')),
                ('code', isc_common.fields.code_field.CodeField(blank=True, null=True)),
                ('name', isc_common.fields.name_field.NameField(blank=True, null=True)),
                ('description', isc_common.fields.description_field.DescriptionField()),
                ('date', models.DateTimeField()),
                ('qty', models.PositiveIntegerField()),
                ('demand', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, to='sales.Demand')),
                ('parent', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='production.Launches')),
                ('status', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, to='sales.Status_launch')),
            ],
            options={
                'verbose_name': 'Запуски',
            },
        ),
        migrations.CreateModel(
            name='Launch_items',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False, verbose_name='Идентификатор')),
                ('deleted_at', models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='Дата мягкого удаления')),
                ('editing', models.BooleanField(default=True, verbose_name='Возможность редактирования')),
                ('deliting', models.BooleanField(default=True, verbose_name='Возможность удаления')),
                ('lastmodified', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='Последнее обновление')),
                ('item', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, to='ckk.Item')),
                ('launch', isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='production.Launches')),
            ],
            options={
                'verbose_name': 'Товарные позиции в запуске',
            },
        ),
        migrations.CreateModel(
            name='Launch_item_refs',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False, verbose_name='Идентификатор')),
                ('deleted_at', models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='Дата мягкого удаления')),
                ('editing', models.BooleanField(default=True, verbose_name='Возможность редактирования')),
                ('deliting', models.BooleanField(default=True, verbose_name='Возможность удаления')),
                ('lastmodified', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='Последнее обновление')),
                ('child', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, related_name='launch_child', to='production.Launch_items')),
                ('item_refs', isc_common.fields.related.ForeignKeySetNull(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ckk.Item_refs')),
                ('parent', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='launch_parent', to='production.Launch_items')),
            ],
            options={
                'verbose_name': 'Кросс таблица',
            },
        ),
        migrations.CreateModel(
            name='Launch_item_line',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False, verbose_name='Идентификатор')),
                ('deleted_at', models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='Дата мягкого удаления')),
                ('editing', models.BooleanField(default=True, verbose_name='Возможность редактирования')),
                ('deliting', models.BooleanField(default=True, verbose_name='Возможность удаления')),
                ('lastmodified', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='Последнее обновление')),
                ('section', isc_common.fields.code_field.CodeStrictField()),
                ('section_num', models.PositiveIntegerField(blank=True, null=True)),
                ('subsection', isc_common.fields.name_field.NameField(blank=True, null=True)),
                ('SPC_CLM_COUNT', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_COUNT', to='kd.Document_attributes', verbose_name='Количество')),
                ('SPC_CLM_FACTORY', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_FACTORY', to='kd.Document_attributes', verbose_name='Предприятие - изготовитель')),
                ('SPC_CLM_FORMAT', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_FORMAT', to='kd.Document_attributes', verbose_name='Формат')),
                ('SPC_CLM_KOD', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_KOD', to='kd.Document_attributes', verbose_name='Код')),
                ('SPC_CLM_MARK', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_MARK', to='kd.Document_attributes', verbose_name='Обозначение')),
                ('SPC_CLM_MASSA', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_MASSA', to='kd.Document_attributes', verbose_name='Масса')),
                ('SPC_CLM_MATERIAL', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_MATERIAL', to='kd.Document_attributes', verbose_name='Материал')),
                ('SPC_CLM_NAME', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_NAME', to='kd.Document_attributes', verbose_name='Наименование')),
                ('SPC_CLM_NOTE', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_NOTE', to='kd.Document_attributes', verbose_name='Примечание')),
                ('SPC_CLM_POS', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_POS', to='kd.Document_attributes', verbose_name='Позиция')),
                ('SPC_CLM_USER', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_USER', to='kd.Document_attributes', verbose_name='Пользовательская')),
                ('SPC_CLM_ZONE', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Launch_SPC_CLM_ZONE', to='kd.Document_attributes', verbose_name='Зона')),
                ('child', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, related_name='Launch_item_child', to='production.Launch_items', verbose_name='Товарная позиция')),
                ('item_line', isc_common.fields.related.ForeignKeySetNull(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ckk.Item_line')),
                ('parent', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, related_name='Launch_item_parent', to='production.Launch_items', verbose_name='Товарная позиция')),
            ],
            options={
                'verbose_name': 'Строка состава изделия',
                'ordering': ['section'],
                'unique_together': {('parent', 'child')},
            },
        ),
    ]
