# Generated by Django 3.0.3 on 2020-02-27 08:19

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.description_field
import isc_common.fields.name_field
import isc_common.fields.related


class Migration(migrations.Migration):

    dependencies = [
        ('production', '0212_auto_20200226_1412'),
    ]

    operations = [
        migrations.CreateModel(
            name='Operations_template',
            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()),
            ],
            options={
                'verbose_name': 'Шаблоны группы операций',
            },
        ),
        migrations.CreateModel(
            name='Operations_template_detail',
            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='Последнее обновление')),
            ],
            options={
                'verbose_name': 'Детализация шаблона группы оперций',
            },
        ),
        # migrations.RemoveConstraint(
        #     model_name='resource',
        #     name='Resource_unique_constraint_0',
        # ),
        # migrations.RemoveConstraint(
        #     model_name='resource',
        #     name='Resource_unique_constraint_1',
        # ),
        migrations.AddField(
            model_name='operations_template_detail',
            name='operation',
            field=isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='production.Operations'),
        ),
        migrations.AddField(
            model_name='operations_template_detail',
            name='template',
            field=isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='production.Operations_template'),
        ),
    ]
