# Generated by Django 2.2 on 2021-07-09 16:31

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(max_length=35, verbose_name='Тип носителя')),
            ],
        ),
        migrations.CreateModel(
            name='Distributor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=75, verbose_name='Дистрибьютор')),
                ('address', models.CharField(blank=True, max_length=50, null=True, verbose_name='Местоположение')),
            ],
        ),
        migrations.CreateModel(
            name='License',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('act', models.CharField(max_length=20, verbose_name='Номер акта П/П')),
                ('date', models.DateField(blank=True, null=True, verbose_name='Дата акта')),
                ('amount', models.IntegerField(blank=True, null=True, verbose_name='Количество лицензий')),
                ('comment', models.TextField(blank=True, null=True)),
                ('distributor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='distruitors', to='events.Distributor', verbose_name='Распространитель')),
            ],
        ),
        migrations.CreateModel(
            name='Network',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=35, verbose_name='Номер сети')),
            ],
        ),
        migrations.CreateModel(
            name='Organisation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reg_number', models.PositiveIntegerField(blank=True, null=True, verbose_name='Регистрационный номер')),
                ('reg_date', models.DateField(blank=True, null=True, verbose_name='Дата присоединения к Регламенту')),
                ('inn', models.CharField(max_length=10, verbose_name='ИНН')),
                ('kpp', models.CharField(blank=True, max_length=8, null=True, verbose_name='КПП')),
                ('full_name', models.CharField(max_length=150, verbose_name='Название')),
                ('short_name', models.CharField(max_length=75, verbose_name='Название')),
                ('address', models.CharField(blank=True, max_length=100, null=True, verbose_name='Адрес организации')),
                ('phone', models.CharField(blank=True, max_length=15, null=True, verbose_name='Номер телефона')),
                ('employee', models.CharField(blank=True, max_length=30, null=True, verbose_name='Ответственный за СКЗИ')),
                ('comment', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Region',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=35, verbose_name='Населенный пункт')),
            ],
        ),
        migrations.CreateModel(
            name='Vpn',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reg_number', models.PositiveIntegerField(blank=True, null=True, verbose_name='Рег. номер СКИ')),
                ('reg_date', models.DateField(blank=True, null=True, verbose_name='Дата выдачи СКИ')),
                ('vpn_number', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='Номер VPN')),
                ('device_id', models.CharField(blank=True, max_length=30, null=True, verbose_name='Идентификатор устройства')),
                ('comment', models.TextField(blank=True, null=True, verbose_name='Примечание')),
                ('device_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='devices', to='events.Device', verbose_name='Тип носителя')),
                ('license', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='lics', to='events.License', verbose_name='Акт П/П')),
                ('network', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='nets', to='events.Network')),
                ('organisation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orgs', to='events.Organisation', verbose_name='Организация')),
            ],
            options={
                'ordering': ['id'],
            },
        ),
        migrations.AddField(
            model_name='organisation',
            name='town',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='events.Region', verbose_name='Населенный пункт'),
        ),
    ]
