Fix DB Migration for SQLite to upgrade to 2.0 (#13921)
closes https://github.com/apache/airflow/issues/13877
This commit is contained in:
Родитель
df11a1d7dc
Коммит
7f45e62fdf
|
@ -47,7 +47,9 @@ def upgrade(): # noqa: D103
|
|||
|
||||
if 'known_event' in tables:
|
||||
for fkey in inspector.get_foreign_keys(table_name="known_event", referred_table="users"):
|
||||
op.drop_constraint(fkey['name'], 'known_event', type_="foreignkey")
|
||||
if fkey['name']:
|
||||
with op.batch_alter_table(table_name='known_event') as bop:
|
||||
bop.drop_constraint(fkey['name'], type_="foreignkey")
|
||||
|
||||
if "chart" in tables:
|
||||
op.drop_table(
|
||||
|
|
Загрузка…
Ссылка в новой задаче