From 4c413e231cfe788de6e371567f395c8ccbd26103 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 10 Jan 2015 20:27:30 +0100 Subject: Fixed #17785 -- Preferred column names in get_relations introspection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks Thomas Güttler for the report and the initial patch, and Tim Graham for the review. --- django/db/backends/oracle/introspection.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'django/db/backends/oracle/introspection.py') diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py index a16a021867..3dab5e36f2 100644 --- a/django/db/backends/oracle/introspection.py +++ b/django/db/backends/oracle/introspection.py @@ -78,12 +78,12 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): def get_relations(self, cursor, table_name): """ - Returns a dictionary of {field_index: (field_index_other_table, other_table)} - representing all relationships to the given table. Indexes are 0-based. + Returns a dictionary of {field_name: (field_name_other_table, other_table)} + representing all relationships to the given table. """ table_name = table_name.upper() cursor.execute(""" - SELECT ta.column_id - 1, tb.table_name, tb.column_id - 1 + SELECT ta.column_name, tb.table_name, tb.column_name FROM user_constraints, USER_CONS_COLUMNS ca, USER_CONS_COLUMNS cb, user_tab_cols ta, user_tab_cols tb WHERE user_constraints.table_name = %s AND -- cgit v1.2.1