mirror of https://github.com/morpheus65535/bazarr
no log: hide warning during initial database migration
This commit is contained in:
parent
a10e5dbf37
commit
d64d6b0a01
|
@ -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 ###
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue