aboutsummaryrefslogtreecommitdiffhomepage
path: root/migrations/versions/b183a2ac0dd1_.py
diff options
context:
space:
mode:
authorJayZed <[email protected]>2024-09-29 21:05:46 -0400
committerJayZed <[email protected]>2024-09-29 21:05:46 -0400
commitc2a1e4d62c1bbb372127a78e4419a96d3c00e81c (patch)
treeaf19b97bbb71b514ef39928e55769fa85064e23a /migrations/versions/b183a2ac0dd1_.py
parent4cc6806193127f9d6d3f2dab26969471d9bbf159 (diff)
parent0200bb96d98127ee32b6b66f8d6b9e21d4571a4d (diff)
downloadbazarr-c2a1e4d62c1bbb372127a78e4419a96d3c00e81c.tar.gz
bazarr-c2a1e4d62c1bbb372127a78e4419a96d3c00e81c.zip
Merge branch 'development' of https://github.com/morpheus65535/bazarr into developmentv1.4.5-beta.7
Diffstat (limited to 'migrations/versions/b183a2ac0dd1_.py')
-rw-r--r--migrations/versions/b183a2ac0dd1_.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/migrations/versions/b183a2ac0dd1_.py b/migrations/versions/b183a2ac0dd1_.py
new file mode 100644
index 000000000..a36a0caac
--- /dev/null
+++ b/migrations/versions/b183a2ac0dd1_.py
@@ -0,0 +1,32 @@
+"""Alter table_languages_profiles.originalFormat type to from bool to int
+
+Revision ID: b183a2ac0dd1
+Revises: 30f37e2e15e1
+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.
+revision = 'b183a2ac0dd1'
+down_revision = '30f37e2e15e1'
+branch_labels = None
+depends_on = None
+
+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())
+
+
+def downgrade():
+ pass