"""add current_step_code to thread_state (Спринт 6a) Revision ID: b5e91c2d07f1 Revises: a4c82f1b9e33 Create Date: 2026-04-24 18:45:00.000000 В state machine v2 шаги идентифицируются строковыми кодами (intro/qualify/...). Старая колонка `current_step` (int) осталась для обратной совместимости отображения, но не используется логикой state machine. """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa revision: str = 'b5e91c2d07f1' down_revision: Union[str, None] = 'a4c82f1b9e33' branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: with op.batch_alter_table('thread_state', recreate='always') as batch: batch.add_column(sa.Column('current_step_code', sa.String(length=50), nullable=True)) def downgrade() -> None: with op.batch_alter_table('thread_state', recreate='always') as batch: batch.drop_column('current_step_code')