open-law/migrations/versions/5df1fabbee7d_approved_field...

41 lines
1.2 KiB
Python

"""approved fields
Revision ID: 5df1fabbee7d
Revises: 1dfa1f2c208f
Create Date: 2023-05-11 15:06:42.883725
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5df1fabbee7d'
down_revision = '1dfa1f2c208f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('comments', schema=None) as batch_op:
batch_op.add_column(sa.Column('approved', sa.Boolean(), nullable=True))
batch_op.drop_column('included_with_interpretation')
with op.batch_alter_table('interpretations', schema=None) as batch_op:
batch_op.add_column(sa.Column('approved', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('interpretations', schema=None) as batch_op:
batch_op.drop_column('approved')
with op.batch_alter_table('comments', schema=None) as batch_op:
batch_op.add_column(sa.Column('included_with_interpretation', sa.BOOLEAN(), autoincrement=False, nullable=True))
batch_op.drop_column('approved')
# ### end Alembic commands ###