# Generated by Django 6.0.3 on 2026-03-12 07:09

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='QuotaConfig',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('default_daily_limit', models.IntegerField(default=50, verbose_name='默认每日上限')),
                ('default_monthly_limit', models.IntegerField(default=500, verbose_name='默认每月上限')),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': '配额配置',
                'verbose_name_plural': '配额配置',
            },
        ),
        migrations.CreateModel(
            name='GenerationRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('task_id', models.UUIDField(default=uuid.uuid4, unique=True, verbose_name='任务ID')),
                ('prompt', models.TextField(blank=True, verbose_name='提示词')),
                ('mode', models.CharField(choices=[('universal', '全能参考'), ('keyframe', '首尾帧')], max_length=20, verbose_name='创作模式')),
                ('model', models.CharField(choices=[('seedance_2.0', 'Seedance 2.0'), ('seedance_2.0_fast', 'Seedance 2.0 Fast')], max_length=30, verbose_name='模型')),
                ('aspect_ratio', models.CharField(max_length=10, verbose_name='宽高比')),
                ('duration', models.IntegerField(verbose_name='时长(秒)')),
                ('status', models.CharField(choices=[('queued', '排队中'), ('processing', '生成中'), ('completed', '已完成'), ('failed', '失败')], default='queued', max_length=20, verbose_name='状态')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='创建时间')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='generation_records', to=settings.AUTH_USER_MODEL, verbose_name='用户')),
            ],
            options={
                'verbose_name': '生成记录',
                'verbose_name_plural': '生成记录',
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['user', 'created_at'], name='generation__user_id_371350_idx')],
            },
        ),
    ]
