summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2024-09-26 21:37:34 -0400
committermorpheus65535 <[email protected]>2024-09-26 21:37:34 -0400
commit25098e5e07533f9eea9602d6a37380aa68a86bbb (patch)
treeda9e4a42148c9e163181a06e62db7b42384e42db
parentc11bdf34fadd49ea39cc73e471cc9a3075e492f4 (diff)
downloadbazarr-25098e5e07533f9eea9602d6a37380aa68a86bbb.tar.gz
bazarr-25098e5e07533f9eea9602d6a37380aa68a86bbb.zip
Fixed database migration issue with postgresql. #2664
-rw-r--r--migrations/versions/b183a2ac0dd1_.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/migrations/versions/b183a2ac0dd1_.py b/migrations/versions/b183a2ac0dd1_.py
index 3a8c16339..a36a0caac 100644
--- a/migrations/versions/b183a2ac0dd1_.py
+++ b/migrations/versions/b183a2ac0dd1_.py
@@ -7,6 +7,7 @@ Create Date: 2024-02-16 10:32:39.123456
"""
from alembic import op
import sqlalchemy as sa
+from app.database import TableLanguagesProfiles
# revision identifiers, used by Alembic.
@@ -19,6 +20,9 @@ bind = op.get_context().bind
def upgrade():
+ op.execute(sa.update(TableLanguagesProfiles)
+ .values({TableLanguagesProfiles.originalFormat: 0})
+ .where(TableLanguagesProfiles.originalFormat.is_(None)))
if bind.engine.name == 'postgresql':
with op.batch_alter_table('table_languages_profiles') as batch_op:
batch_op.alter_column('originalFormat', type_=sa.Integer())