Files
life-echo/api/alembic/versions/0006_segment_memoir_phase_flags.py

43 lines
981 B
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.
"""segmentsPhase1/Phase2 标志(叙事延迟管线)
Revision ID: 0006_segment_memoir_phases
Revises: 0005_cleanup_story_links
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
revision: str = "0006_segment_memoir_phases"
down_revision: Union[str, None] = "0005_cleanup_story_links"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.add_column(
"segments",
sa.Column(
"narrated",
sa.Boolean(),
nullable=False,
server_default=sa.text("false"),
),
)
op.add_column(
"segments",
sa.Column(
"skip_narrative",
sa.Boolean(),
nullable=False,
server_default=sa.text("false"),
),
)
def downgrade() -> None:
op.drop_column("segments", "skip_narrative")
op.drop_column("segments", "narrated")