Files

38 lines
1.1 KiB
Python
Raw Permalink Normal View History

"""add paused to round_config
Revision ID: 5f2079b95b33
Revises: 1db52f3a7c67
Create Date: 2026-07-22 00:00:00.000000
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '5f2079b95b33'
down_revision: Union[str, Sequence[str], None] = '1db52f3a7c67'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# server_default backfills the existing singleton row (if any); dropped right
# after so new rows go through the ORM default instead of a stale constant.
op.add_column(
'round_config', sa.Column('paused', sa.Boolean(), nullable=False, server_default=sa.false())
)
with op.batch_alter_table('round_config') as batch_op:
batch_op.alter_column('paused', server_default=None)
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('round_config', 'paused')
# ### end Alembic commands ###