36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
"""Add reversible task clearing
|
|
|
|
Revision ID: 5ad737bbca5e
|
|
Revises: f9ae19443d53
|
|
Create Date: 2026-08-08 03:11:59.276494
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '5ad737bbca5e'
|
|
down_revision = 'f9ae19443d53'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('task', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('cleared_at', sa.DateTime(), nullable=True))
|
|
batch_op.add_column(sa.Column('clear_batch_id', sa.String(length=36), nullable=True))
|
|
batch_op.create_index(batch_op.f('ix_task_clear_batch_id'), ['clear_batch_id'], unique=False)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('task', schema=None) as batch_op:
|
|
batch_op.drop_index(batch_op.f('ix_task_clear_batch_id'))
|
|
batch_op.drop_column('clear_batch_id')
|
|
batch_op.drop_column('cleared_at')
|
|
|
|
# ### end Alembic commands ###
|