kaxil commented on a change in pull request #13921:
URL: https://github.com/apache/airflow/pull/13921#discussion_r566512824



##########
File path: airflow/migrations/versions/cf5dc11e79ad_drop_user_and_chart.py
##########
@@ -47,7 +47,12 @@ 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 conn.dialect.name == "sqlite":
+                if fkey['name']:
+                    with op.batch_alter_table(table_name='known_event') as bop:
+                        bop.drop_constraint(fkey['name'], type_="foreignkey")
+            else:
+                op.drop_constraint(fkey['name'], 'known_event', 
type_="foreignkey")

Review comment:
       Just tested it on Postgres too -- worked fine -- pushed the changes in 
https://github.com/apache/airflow/pull/13921/commits/890aa9336fa8d1ecf5f7305095bad44d9b961d97




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to