# Generated by Django 3.1.4 on 2020-12-03 17:40

import bitfield.models
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import isc_common.fields.code_field
import isc_common.fields.related


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('ckk', '0270_auto_20201113_0846'),
        ('production', '0321_auto_20201120_0956'),
        ('isc_common', '0056_last_used_processes'),
        ('planing', '0275_auto_20201203_1253'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='production_order_tmp',
            options={'verbose_name': 'Временная таблица для выполнений пл Заказам на производство'},
        ),
        migrations.CreateModel(
            name='Production_order_made_history',
            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='Последнее обновление')),
                ('arranges_exucutors', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('childs', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('child_launches', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('cnt_opers', models.PositiveIntegerField(blank=True, null=True)),
                ('date', models.DateTimeField(blank=True, default=None, null=True)),
                ('demand_codes_str', isc_common.fields.code_field.CodeField(blank=True, null=True)),
                ('demand_ids', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('description', models.TextField(blank=True, null=True)),
                ('edizm_arr', django.contrib.postgres.fields.ArrayField(base_field=isc_common.fields.code_field.CodeField(blank=True, null=True), blank=True, default=list, null=True, size=None)),
                ('enabled', models.BooleanField(blank=True, null=True)),
                ('exucutors', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('exucutors_old', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('has_color', models.BooleanField(blank=True, null=True)),
                ('has_launched', models.BooleanField(blank=True, null=True)),
                ('id_f', models.BigIntegerField(db_index=True)),
                ('id_real', models.BigIntegerField(db_index=True)),
                ('isDeleted', models.BooleanField(blank=True, null=True)),
                ('isFolder', models.BooleanField(blank=True, null=True)),
                ('launches_odd', isc_common.fields.code_field.JSONFieldIVC(blank=True, default=dict, null=True, verbose_name=models.TextField())),
                ('level', models.SmallIntegerField(blank=True, null=True)),
                ('location_ids', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('location_ids_old', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('location_sector_ids', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('location_sectors_full_name', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), blank=True, default=list, null=True, size=None)),
                ('location_status_colors', isc_common.fields.code_field.JSONFieldIVC(blank=True, default=dict, null=True)),
                ('location_status_ids', isc_common.fields.code_field.JSONFieldIVC(blank=True, default=dict, null=True)),
                ('location_statuses', isc_common.fields.code_field.JSONFieldIVC(blank=True, default=dict, null=True)),
                ('locations_sector_full_name', isc_common.fields.code_field.JSONFieldIVC(blank=True, default=dict, null=True)),
                ('num', isc_common.fields.code_field.CodeField(blank=True, null=True)),
                ('parent_id', models.BigIntegerField(blank=True, null=True)),
                ('parent_item_ids', django.contrib.postgres.fields.ArrayField(base_field=models.BigIntegerField(), blank=True, default=list, null=True, size=None)),
                ('parent_mul', models.SmallIntegerField(blank=True, null=True)),
                ('process', models.BigIntegerField(db_index=True, default=None)),
                ('props', bitfield.models.BitField((('inner_routing', 'Связь операций внутри товарной позиции'), ('outer_routing', 'Связь операций между товарными позициями'), ('product_order_routing', 'Связи в блоке задания на производство'), ('product_making', 'Связи выпуска'), ('product_making_block', 'Блок операций выпуска, удаляется как одно целое'), ('maked_for_grouped', 'Создано как группирующая позиция, (избыточная)')), db_index=True, default=0)),
                ('value1_sum', django.contrib.postgres.fields.ArrayField(base_field=models.DecimalField(decimal_places=4, max_digits=19), blank=True, null=True, size=None)),
                ('value_made', models.DecimalField(blank=True, decimal_places=4, max_digits=19, null=True, verbose_name='Количество  Выпущено')),
                ('value_odd', models.DecimalField(blank=True, decimal_places=4, max_digits=19, null=True, verbose_name='Количество  Выпущено')),
                ('value_start', models.DecimalField(blank=True, decimal_places=4, max_digits=19, null=True, verbose_name='Количество Запущено')),
                ('value_sum', models.DecimalField(blank=True, decimal_places=4, max_digits=19, null=True, verbose_name='Количество по документации')),
                ('color', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Production_order_made_history_color', to='isc_common.standard_colors')),
                ('creator', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Production_order_made_history_creator', to=settings.AUTH_USER_MODEL)),
                ('edizm', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Production_order_made_history_edizmr', to='ckk.ed_izm')),
                ('item', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Production_order_made_history_item', to='ckk.item')),
                ('launch', isc_common.fields.related.ForeignKeyCascade(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Production_order_made_history_launch', to='production.launches')),
                ('launch_incom', isc_common.fields.related.ForeignKeyCascade(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Production_order_made_history_launch_incom', to='production.launches')),
                ('opertype', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, related_name='Production_order_made_history_opertype', to='planing.operation_types')),
                ('parent_item', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='Production_order_made_history_parent_item', to='ckk.item')),
                ('status', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, to='planing.status_operation_types')),
            ],
            options={
                'verbose_name': 'Выполнения по Заказам на производство',
            },
        ),
    ]
