Skip to content

Commit

Permalink
fix(migration): Catch DatabaseError to avoid migration crash with MyS…
Browse files Browse the repository at this point in the history
…QL 8.0 (#21679)
  • Loading branch information
qlands authored Oct 4, 2022
1 parent abc0f19 commit 5da20f4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def upgrade():
new_column_name="allow_file_upload",
existing_type=sa.Boolean(),
)
except sa.exc.OperationalError:
except (sa.exc.OperationalError, sa.exc.DatabaseError):
# In MySQL 8.0 renaming the column rename fails because it has
# a constraint check; we can safely remove it in that case, see
# https://github.com/sqlalchemy/alembic/issues/699
Expand Down

0 comments on commit 5da20f4

Please sign in to comment.