# Generated by Django 3.1.2 on 2021-01-21 12:45

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('nomenclature', '0031_madicinedata'),
    ]

    operations = [
        migrations.CreateModel(
            name='Biomaterial',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=20, unique=True, verbose_name='Код биоматериала')),
                ('name', models.CharField(max_length=200, unique=True, verbose_name='Название биоматериала')),
                ('type', models.SmallIntegerField(verbose_name='Тип биоматериала')),
            ],
        ),
        migrations.CreateModel(
            name='BiomaterialContainer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('biomaterial', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nomenclature.biomaterial', verbose_name='Биоматериал')),
            ],
        ),
        migrations.CreateModel(
            name='Container',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=50, unique=True, verbose_name='Код контейнера')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='Наименование контейнера')),
            ],
        ),
        migrations.CreateModel(
            name='BiomaterialContainerGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('biomaterial_container', models.ManyToManyField(related_name='Группы', to='nomenclature.BiomaterialContainer')),
            ],
        ),
        migrations.AddField(
            model_name='biomaterialcontainer',
            name='container',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nomenclature.container', verbose_name='Контейнер'),
        ),
        migrations.AddField(
            model_name='service',
            name='bm_cont_groups',
            field=models.ManyToManyField(related_name='биоматериалы', to='nomenclature.BiomaterialContainerGroup'),
        ),
    ]
