"""Add editing_mode to generation_tasks

Revision ID: 007
Revises: 006
Create Date: 2026-06-26
"""

import sqlalchemy as sa

from alembic import op

# revision identifiers
revision = "007"
down_revision = "006"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column(
        "generation_tasks", sa.Column("editing_mode", sa.String(20), nullable=False, server_default="one_take")
    )
    # 添加索引以支持查询
    op.create_index("ix_generation_tasks_editing_mode", "generation_tasks", ["editing_mode"])


def downgrade() -> None:
    op.drop_index("ix_generation_tasks_editing_mode", table_name="generation_tasks")
    op.drop_column("generation_tasks", "editing_mode")
