# Generated by Django 5.2.6 on 2025-09-19 18:00

import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Scheduler',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True, verbose_name='名称')),
                ('interval', models.IntegerField(default=1, verbose_name='运行间隔(秒)')),
                ('locked', models.BooleanField(default=False, verbose_name='是否被锁')),
                ('owner', models.CharField(default='85416@bizhongliangdeMacBook-Air.local:30994a', max_length=200, verbose_name='锁持有者')),
                ('locked_time', models.DateTimeField(blank=True, null=True, verbose_name='上锁时间')),
                ('last_tick_time', models.DateTimeField(blank=True, null=True, verbose_name='上次tick时间')),
                ('last_tick_success', models.BooleanField(default=True, verbose_name='上次调度是否成功')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '调度器',
                'verbose_name_plural': '调度器',
                'db_table': 'django_sched_scheduler',
            },
        ),
        migrations.CreateModel(
            name='SchedulerLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('scheduler', models.CharField(max_length=100, verbose_name='调度')),
                ('owner', models.CharField(max_length=200, verbose_name='执行者')),
                ('success', models.BooleanField(default=True, verbose_name='是否成功')),
                ('started_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='开始时间')),
                ('finished_at', models.DateTimeField(blank=True, null=True, verbose_name='结束时间')),
                ('message', models.TextField(blank=True, verbose_name='日志/异常信息')),
                ('duration', models.FloatField(blank=True, null=True, verbose_name='耗时(秒)')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='创建时间')),
            ],
            options={
                'verbose_name': '调度日志',
                'verbose_name_plural': '调度日志',
                'db_table': 'django_sched_log',
                'ordering': ['-started_at'],
            },
        ),
    ]
