microblog/alembic/versions/21b9e9d71ba3_add_new_is_tra...

39 lines
1.1 KiB
Python

"""Add new is_transient flag
Revision ID: 21b9e9d71ba3
Revises: edea0406b7d0
Create Date: 2022-07-24 12:33:15.421906
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '21b9e9d71ba3'
down_revision = 'edea0406b7d0'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('inbox', schema=None) as batch_op:
batch_op.add_column(sa.Column('is_transient', sa.Boolean(), server_default='0', nullable=False))
with op.batch_alter_table('outbox', schema=None) as batch_op:
batch_op.add_column(sa.Column('is_transient', sa.Boolean(), server_default='0', nullable=False))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('outbox', schema=None) as batch_op:
batch_op.drop_column('is_transient')
with op.batch_alter_table('inbox', schema=None) as batch_op:
batch_op.drop_column('is_transient')
# ### end Alembic commands ###