添加全能创作功能
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
# Generated by Django 5.1.15 on 2026-09-02 09:45
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0009_team_price_multiplier'),
|
||||
('ai', '0033_seedance_25_capabilities'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CreationConversation',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('title', models.CharField(default='未命名创作', max_length=120)),
|
||||
('mode', models.CharField(choices=[('video', '视频创作'), ('image', '图片创作')], default='video', max_length=16)),
|
||||
('preset', models.CharField(blank=True, default='', max_length=64)),
|
||||
('params', models.JSONField(blank=True, default=dict)),
|
||||
('pinned_refs', models.JSONField(blank=True, default=list)),
|
||||
('memory', models.JSONField(blank=True, default=dict)),
|
||||
('status', models.CharField(choices=[('running', '进行中'), ('completed', '已完成'), ('failed', '失败')], default='running', max_length=16)),
|
||||
('last_active_at', models.DateTimeField(auto_now_add=True)),
|
||||
('is_deleted', models.BooleanField(default=False)),
|
||||
('purged_at', models.DateTimeField(blank=True, null=True)),
|
||||
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_%(class)s_set', to=settings.AUTH_USER_MODEL)),
|
||||
('team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='accounts.team')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CreationMessage',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('role', models.CharField(choices=[('user', '用户'), ('assistant', 'AI'), ('system', '系统')], max_length=16)),
|
||||
('kind', models.CharField(choices=[('text', '文字气泡'), ('elicit', '追问卡'), ('strategy', '创作策略理解卡'), ('plan', '视频最终方案卡'), ('prompt_file', '生成 Prompt 文件卡'), ('confirm', '确认闸门(带预计积分)'), ('generating', '生成中'), ('result', '生成结果'), ('error', '错误')], default='text', max_length=24)),
|
||||
('text', models.TextField(blank=True, default='')),
|
||||
('payload', models.JSONField(blank=True, default=dict)),
|
||||
('refs', models.JSONField(blank=True, default=list)),
|
||||
('seq', models.PositiveIntegerField(default=0)),
|
||||
('conversation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='ai.creationconversation')),
|
||||
('task', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='creation_messages', to='ai.aitask')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['seq', 'created_at'],
|
||||
},
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='creationconversation',
|
||||
index=models.Index(fields=['team', '-last_active_at'], name='ai_creation_team_id_82f111_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='creationconversation',
|
||||
index=models.Index(fields=['team', 'status', '-last_active_at'], name='ai_creation_team_id_3aa2e5_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='creationconversation',
|
||||
index=models.Index(fields=['team', 'is_deleted', 'purged_at'], name='ai_creation_team_id_26e56a_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='creationmessage',
|
||||
index=models.Index(fields=['conversation', 'seq'], name='ai_creation_convers_e9c745_idx'),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='creationmessage',
|
||||
constraint=models.UniqueConstraint(fields=('conversation', 'seq'), name='uniq_creation_message_seq'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user