# Generated by Django 3.1.2 on 2020-10-17 15:27

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Notice',
            fields=[
                ('deleted_at', models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('status', models.IntegerField(choices=[(-1, 'Error'), (0, 'Waiting'), (2, 'Running'), (3, 'Finish')], default=0, verbose_name='Notice status')),
                ('started_at', models.DateTimeField(blank=True, null=True, verbose_name='Started at')),
                ('finished_at', models.DateTimeField(blank=True, null=True, verbose_name='Finished at')),
                ('model', models.CharField(blank=True, default='', max_length=128, verbose_name='发送模型')),
                ('model_id', models.CharField(blank=True, default='', max_length=128, null=True, verbose_name='发送模型ID')),
                ('model_method', models.CharField(blank=True, default='', max_length=64, null=True, verbose_name='发送模型方法')),
                ('cid', models.CharField(blank=True, default='', max_length=128, verbose_name='Celery ID')),
            ],
            options={
                'verbose_name': 'Notice list',
                'ordering': ('-created_at',),
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('deleted_at', models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('status', models.IntegerField(choices=[(-1, 'Error'), (0, 'Waiting'), (2, 'Running'), (3, 'Finish')], default=0, verbose_name='Task status')),
                ('cmd', models.CharField(max_length=1024)),
                ('rc', models.IntegerField(null=True)),
                ('msg', models.CharField(max_length=10240)),
                ('started_at', models.DateTimeField(blank=True, null=True)),
                ('finished_at', models.DateTimeField(blank=True, null=True)),
                ('submitter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Task',
                'verbose_name_plural': 'Tasks',
                'ordering': ('status',),
            },
        ),
    ]
