Skip to content

Commit

Permalink
Refs #20483 -- Removed unneeded column from _foreign_key_constraints(…
Browse files Browse the repository at this point in the history
…) on Oracle.
  • Loading branch information
felixxm committed Jun 6, 2017
1 parent 4ad2f86 commit 5e9f7f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions django/db/backends/oracle/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def _foreign_key_constraints(self, table_name, recursive=False):
if recursive:
cursor.execute("""
SELECT
user_tables.table_name, rcons.constraint_name, MAX(level)
user_tables.table_name, rcons.constraint_name
FROM
user_tables
JOIN
Expand All @@ -314,16 +314,14 @@ def _foreign_key_constraints(self, table_name, recursive=False):
else:
cursor.execute("""
SELECT
cons.table_name, cons.constraint_name, 1
cons.table_name, cons.constraint_name
FROM
user_constraints cons
WHERE
cons.constraint_type = 'R'
AND cons.table_name = UPPER(%s)
""", (table_name,))
return [
(foreign_table, constraint) for foreign_table, constraint, _ in cursor.fetchall()
]
return cursor.fetchall()

def sql_flush(self, style, tables, sequences, allow_cascade=False):
if tables:
Expand Down

0 comments on commit 5e9f7f1

Please sign in to comment.