diff options
author | Claude Paroz <claude@2xlibre.net> | 2015-01-10 20:27:30 +0100 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2015-01-12 19:58:47 +0100 |
commit | 4c413e231cfe788de6e371567f395c8ccbd26103 (patch) | |
tree | 8b2100a8d9d650546615c8c1cd3b8f52251690a3 /django/db/backends/oracle/introspection.py | |
parent | b75c707943e159b80c179c538721406bbfb8b120 (diff) | |
download | django-4c413e231cfe788de6e371567f395c8ccbd26103.tar.gz |
Fixed #17785 -- Preferred column names in get_relations introspection
Thanks Thomas Güttler for the report and the initial patch, and
Tim Graham for the review.
Diffstat (limited to 'django/db/backends/oracle/introspection.py')
-rw-r--r-- | django/db/backends/oracle/introspection.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 |