Files
beige/backend/alembic/versions/010_fission_tasks_table.py
yangqianqian 6a2632da70 baseline: Clover 独立仓库首次基线提交
将 Clover 从上层产品包旧仓库中独立出来,建立专属版本控制。
当前状态=纵切片端到端已打通(登录→选品→出文出图→审核→下载包),
M1文案质量去套路化已验收。此提交作为后续按核销清单逐条修复的基线。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 11:30:22 +08:00

71 lines
1.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""create fission_tasks table
Revision ID: 010
Revises: 009
Create Date: 2026-06-13
第11环裂变引擎1爆款→N套完整笔记包非只换文案
fission_tasks 是裂变任务主表,挂载在工作台内呈现。
reference_level: low/mid/high参考程度
"""
from alembic import op
import sqlalchemy as sa
revision = "010"
down_revision = "009"
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
"fission_tasks",
sa.Column("id", sa.BigInteger, primary_key=True, autoincrement=True),
sa.Column(
"workspace_id",
sa.BigInteger,
sa.ForeignKey("workspaces.id", ondelete="CASCADE"),
nullable=False,
comment="多租户隔离",
),
sa.Column(
"source_note",
sa.Text,
nullable=True,
comment="爆款源笔记内容(文案+图描述JSON存储",
),
sa.Column(
"reference_level",
sa.String(10),
nullable=False,
server_default="mid",
comment="参考程度: low/mid/high",
),
sa.Column(
"fanout_count",
sa.Integer,
nullable=False,
server_default="3",
comment="裂变套数默认3套",
),
sa.Column(
"status",
sa.String(20),
nullable=False,
server_default="pending",
comment="状态: pending/generating/done/failed",
),
sa.Column(
"created_at",
sa.DateTime,
server_default=sa.func.now(),
nullable=False,
),
)
op.create_index("idx_fission_tasks_workspace_id", "fission_tasks", ["workspace_id"])
def downgrade():
op.drop_index("idx_fission_tasks_workspace_id", table_name="fission_tasks")
op.drop_table("fission_tasks")