From 5da20f449d70ffa669137f1513b76acd434a7137 Mon Sep 17 00:00:00 2001 From: QLands Date: Tue, 4 Oct 2022 03:07:51 -0400 Subject: [PATCH] fix(migration): Catch DatabaseError to avoid migration crash with MySQL 8.0 (#21679) --- .../2021-09-19_14-42_b92d69a6643c_rename_csv_to_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/migrations/versions/2021-09-19_14-42_b92d69a6643c_rename_csv_to_file.py b/superset/migrations/versions/2021-09-19_14-42_b92d69a6643c_rename_csv_to_file.py index b816b24320152..d86c8e9114c05 100644 --- a/superset/migrations/versions/2021-09-19_14-42_b92d69a6643c_rename_csv_to_file.py +++ b/superset/migrations/versions/2021-09-19_14-42_b92d69a6643c_rename_csv_to_file.py @@ -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