no log: hide warning during initial database migration

This commit is contained in:
morpheus65535 2023-11-18 20:06:08 -05:00
parent a10e5dbf37
commit d64d6b0a01
1 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,8 @@ Create Date: 2023-04-12 14:50:25.281288
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import exc as sa_exc
import warnings
try:
from psycopg2.errors import UndefinedObject
@ -46,6 +48,7 @@ def column_type(table_name, column_name):
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
warnings.filterwarnings("ignore", category=sa_exc.SAWarning)
# Update announcements table
with op.batch_alter_table('table_announcements') as batch_op:
@ -266,6 +269,8 @@ def upgrade():
'table_movies_rootfolder_pkey CASCADE;')
batch_op.alter_column(column_name='id', existing_type=sa.INTEGER(), nullable=False, autoincrement=True)
batch_op.create_primary_key(constraint_name='pk_table_movies_rootfolder', columns=['id'])
warnings.filterwarnings("default", category=sa_exc.SAWarning)
# ### end Alembic commands ###