misp-modules/website/migrations/versions/ef119b41c5f2_.py

37 lines
989 B
Python

"""empty message
Revision ID: ef119b41c5f2
Revises: 01de07e2686a
Create Date: 2024-02-06 08:10:37.101421
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.exc import OperationalError
# revision identifiers, used by Alembic.
revision = 'ef119b41c5f2'
down_revision = '01de07e2686a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
try:
with op.batch_alter_table('module__config', schema=None) as batch_op:
batch_op.add_column(sa.Column('request_on_query', sa.Boolean(), nullable=True))
except OperationalError:
print('Coulmn "request_on_query" already exist in "module__config"')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('module__config', schema=None) as batch_op:
batch_op.drop_column('request_on_query')
# ### end Alembic commands ###