Skip to content

Commit

Permalink
Fixed database migration issue with postgresql. #2664
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Sep 27, 2024
1 parent c11bdf3 commit 25098e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions migrations/versions/b183a2ac0dd1_.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""
from alembic import op
import sqlalchemy as sa
from app.database import TableLanguagesProfiles


# revision identifiers, used by Alembic.
Expand All @@ -19,6 +20,9 @@


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())
Expand Down

0 comments on commit 25098e5

Please sign in to comment.