You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2020/12/22 12:53:04 UTC

[airflow] branch master updated: specify constraint key type & drop auto fkey referred to users tables (#13239)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 6409858  specify constraint key type & drop auto fkey referred to users tables (#13239)
6409858 is described below

commit 640985865a9d272569942f3668f2db02164fb1dd
Author: R3da <52...@users.noreply.github.com>
AuthorDate: Tue Dec 22 13:51:41 2020 +0100

    specify constraint key type & drop auto fkey referred to users tables (#13239)
---
 airflow/migrations/versions/cf5dc11e79ad_drop_user_and_chart.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/migrations/versions/cf5dc11e79ad_drop_user_and_chart.py b/airflow/migrations/versions/cf5dc11e79ad_drop_user_and_chart.py
index 0b713a2..d12c78f 100644
--- a/airflow/migrations/versions/cf5dc11e79ad_drop_user_and_chart.py
+++ b/airflow/migrations/versions/cf5dc11e79ad_drop_user_and_chart.py
@@ -46,7 +46,8 @@ def upgrade():  # noqa: D103
     tables = inspector.get_table_names()
 
     if 'known_event' in tables:
-        op.drop_constraint('known_event_user_id_fkey', 'known_event')
+        for fkey in inspector.get_foreign_keys(table_name="known_event", referred_table="users"):
+            op.drop_constraint(fkey['name'], 'known_event', type_="foreignkey")
 
     if "chart" in tables:
         op.drop_table(