diff options
author | morpheus65535 <[email protected]> | 2023-09-22 12:23:03 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2023-09-22 12:23:03 -0400 |
commit | 0ddadb273e8671e183a2d37cd5fc3054b9adbccc (patch) | |
tree | 03dc73b8d04da710637c3761e816b9b74007eff4 | |
parent | 81159a09789aa0251c5a6935ff06ae9e886e7a05 (diff) | |
download | bazarr-1.3.1-beta.3.tar.gz bazarr-1.3.1-beta.3.zip |
Fixed latest migration that cleared history for sqlite users.v1.3.1-beta.3
-rw-r--r-- | migrations/versions/cee6a710cb71_.py | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/migrations/versions/cee6a710cb71_.py b/migrations/versions/cee6a710cb71_.py index 944559d0b..00fb89b22 100644 --- a/migrations/versions/cee6a710cb71_.py +++ b/migrations/versions/cee6a710cb71_.py @@ -15,40 +15,21 @@ down_revision = '195144da1f7e' branch_labels = None depends_on = None +bind = op.get_context().bind + def upgrade(): # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('table_episodes', schema=None) as batch_op: - batch_op.alter_column('file_size', - existing_type=sa.INTEGER(), - type_=sa.BigInteger(), - existing_nullable=True, - existing_server_default=sa.text('0')) - - with op.batch_alter_table('table_movies', schema=None) as batch_op: - batch_op.alter_column('file_size', - existing_type=sa.INTEGER(), - type_=sa.BigInteger(), - existing_nullable=True, - existing_server_default=sa.text('0')) + if bind.engine.name == 'postgresql': + with op.batch_alter_table('table_episodes') as batch_op: + batch_op.alter_column('file_size', type_=sa.BigInteger()) + with op.batch_alter_table('table_movies') as batch_op: + batch_op.alter_column('file_size', type_=sa.BigInteger()) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('table_movies', schema=None) as batch_op: - batch_op.alter_column('file_size', - existing_type=sa.BigInteger(), - type_=sa.INTEGER(), - existing_nullable=True, - existing_server_default=sa.text('0')) - - with op.batch_alter_table('table_episodes', schema=None) as batch_op: - batch_op.alter_column('file_size', - existing_type=sa.BigInteger(), - type_=sa.INTEGER(), - existing_nullable=True, - existing_server_default=sa.text('0')) - + pass # ### end Alembic commands ### |