# Generated by Django 2.2.2 on 2019-06-12 23:01

import bitfield.models
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import isc_common.fields.name_field


class Migration(migrations.Migration):

    dependencies = [
        ('kd', '0046_auto_20190610_0953'),
    ]

    operations = [
        migrations.CreateModel(
            name='Document_attributes_view',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False, verbose_name='Идентификатор')),
                ('id_old', models.BigIntegerField(blank=True, null=True, 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='Последнее обновление')),
                ('value_str', models.TextField(db_index=True, verbose_name='Значение атрибута')),
                ('position_in_document', models.PositiveIntegerField()),
                ('section', isc_common.fields.name_field.NameField()),
                ('subsection', isc_common.fields.name_field.NameField()),
                ('props', bitfield.models.BitField((('relevant', 'Актуальность'), ('copied', 'Копированный')), db_index=True, default=1)),
            ],
            options={
                'verbose_name': 'Аттрибуты докуменнта',
                'db_table': 'kd_document_attrs_mview',
                'managed': False,
            },
        ),
        migrations.AlterUniqueTogether(
            name='document_attrs',
            unique_together=None,
        ),
        migrations.RemoveField(
            model_name='document_attrs',
            name='attr_type',
        ),
        migrations.RemoveField(
            model_name='document_attrs',
            name='document',
        ),
        migrations.DeleteModel(
            name='Cdw_attrs',
        ),
        migrations.DeleteModel(
            name='Spw_attrs',
        ),
        migrations.CreateModel(
            name='Cdw_attrs',
            fields=[
                ('document_attrs_view_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kd.Document_attrs_view')),
            ],
            options={
                'verbose_name': 'Чертеж',
                'managed': False,
            },
            bases=('kd.document_attrs_view',),
        ),
        migrations.CreateModel(
            name='Spw_attrs',
            fields=[
                ('document_attrs_view_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='kd.Document_attrs_view')),
            ],
            options={
                'verbose_name': 'Аттрибуты Спецификаций',
                'managed': False,
            },
            bases=('kd.document_attrs_view',),
        ),
        migrations.DeleteModel(
            name='Document_attrs',
        ),
    ]
