From d64d6b0a018bf40309a5baa80ec852ecb02820ae Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Sat, 18 Nov 2023 20:06:08 -0500 Subject: [PATCH] no log: hide warning during initial database migration --- migrations/versions/dc09994b7e65_.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migrations/versions/dc09994b7e65_.py b/migrations/versions/dc09994b7e65_.py index 6670852b1..e22eabd89 100644 --- a/migrations/versions/dc09994b7e65_.py +++ b/migrations/versions/dc09994b7e65_.py @@ -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 ###