Skip to content

Commit

Permalink
[AIRFLOW-6931] Fixed migrations to find all dependencies for MSSQL (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
BaoshanGu committed Jul 21, 2020
1 parent 5eacc16 commit 8a405d2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def get_table_constraints(conn, table_name):
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc
JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS ccu ON ccu.CONSTRAINT_NAME = tc.CONSTRAINT_NAME
WHERE tc.TABLE_NAME = '{table_name}' AND
(tc.CONSTRAINT_TYPE = 'PRIMARY KEY' or tc.CONSTRAINT_TYPE = 'Unique')
(tc.CONSTRAINT_TYPE = 'PRIMARY KEY' or UPPER(tc.CONSTRAINT_TYPE) = 'UNIQUE')
""".format(table_name=table_name)
result = conn.execute(query).fetchall()
constraint_dict = defaultdict(list)
Expand Down

0 comments on commit 8a405d2

Please sign in to comment.