# Generated by Django 3.0.8 on 2020-07-17 03:23

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


class Migration(migrations.Migration):

    dependencies = [
        ('production', '0283_auto_20200716_1618'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('ckk', '0230_auto_20200708_1517'),
        ('planing', '0202_auto_20200717_0308'),
    ]

    operations = [
        migrations.AddField(
            model_name='operation_history',
            name='hcreator',
            field=isc_common.fields.related.ForeignKeyProtect(default=None, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='operation_operation',
            name='creator',
            field=isc_common.fields.related.ForeignKeyProtect(default=None, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='operation_operation',
            name='props',
            field=bitfield.models.BitField((('direct_created', 'Зозданный после включения в производственную спецификацию'), ('updated', 'Обновленный')), db_index=True, default=0),
        ),
        migrations.AlterField(
            model_name='operation_history',
            name='creator',
            field=isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, related_name='Operation_history_creator', to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='Operation_operation_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='Последнее обновление')),
                ('num', models.PositiveIntegerField(db_index=True)),
                ('qty', models.PositiveIntegerField(blank=True, db_index=True, null=True)),
                ('version', models.PositiveIntegerField(blank=True, db_index=True, null=True)),
                ('props', bitfield.models.BitField((('direct_created', 'Зозданный после включения в производственную спецификацию'), ('updated', 'Обновленный')), db_index=True, default=0)),
                ('creator', isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, related_name='Operation_operation_history_creator', to=settings.AUTH_USER_MODEL)),
                ('ed_izm', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='ckk.Ed_izm')),
                ('hcreator', isc_common.fields.related.ForeignKeyProtect(default=None, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
                ('operation', isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='planing.Operations')),
                ('operation_operation', isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='planing.Operation_operation')),
                ('production_operation', isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='production.Operations')),
            ],
            options={
                'verbose_name': 'История операций',
            },
        ),
    ]
