# Generated by Django 2.2.8 on 2019-12-13 23:51

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 = [
        ('kd', '0099_auto_20191213_2032'),
    ]

    operations = [
        migrations.CreateModel(
            name='Lotsman_documents_hierarcy',
            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='Последнее обновление')),
                ('document', isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='kd.Documents')),
                ('parent', isc_common.fields.related.ForeignKeyProtect(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='kd.Lotsman_documents_hierarcy')),
            ],
            options={
                'verbose_name': 'Иерархия документа из Лоцмана',
            },
        ),
        migrations.CreateModel(
            name='Lotsman_document_attr_cross',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position_in_document', models.PositiveIntegerField()),
                ('section', isc_common.fields.code_field.CodeField(blank=True, null=True, verbose_name='Раздел')),
                ('subsection', isc_common.fields.code_field.CodeField(blank=True, null=True, verbose_name='Подраздел')),
                ('attribute', isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='kd.Document_attributes')),
                ('document', isc_common.fields.related.ForeignKeyCascade(on_delete=django.db.models.deletion.CASCADE, to='kd.Lotsman_documents_hierarcy')),
            ],
            options={
                'verbose_name': 'Кросс таблица',
                'unique_together': {('document', 'position_in_document')},
            },
        ),
    ]
