# Generated by Django 3.1.14 on 2024-09-05 20:35

import uuid

import django.db.models.deletion
import django.utils.timezone
from django.db import (
    migrations,
    models,
)

import educommon.django.db.mixins

import edu_rdm_integration.core.utils


class Migration(migrations.Migration):
    dependencies = [
        ('async_task', '0002_task_type_and_status_data'),
        ('edu_rdm_integration', '0013_set_attachment_size'),
    ]

    operations = [
        migrations.CreateModel(
            name='UploadDataCommand',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                (
                    'logs_link',
                    models.FileField(
                        max_length=255,
                        upload_to=edu_rdm_integration.core.utils.get_data_command_progress_attachment_path,
                        verbose_name='Ссылка на файл логов',
                    ),
                ),
                (
                    'type',
                    models.PositiveSmallIntegerField(
                        choices=[(1, 'Автоматический'), (2, 'Ручной')], verbose_name='Тип команды'
                    ),
                ),
                ('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Дата создания')),
                ('generation_id', models.UUIDField(default=uuid.uuid4, verbose_name='Идентификатор генерации')),
                (
                    'entity',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to='edu_rdm_integration.regionaldatamartentityenum',
                        verbose_name='Сущность РВД',
                    ),
                ),
                (
                    'task',
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to='async_task.runningtask',
                        verbose_name='Асинхронная задача',
                    ),
                ),
            ],
            options={
                'verbose_name': 'Команда отправки данных в витрину',
                'verbose_name_plural': 'Команды отправки данных в витрину',
                'db_table': 'rdm_upload_data_command',
            },
            bases=(educommon.django.db.mixins.ReprStrPreModelMixin, models.Model),
        ),
    ]
