diff options
author | Thomas Grainger <tagrain@gmail.com> | 2018-06-29 15:43:53 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-06-29 10:43:53 -0400 |
commit | 4fba321a457e52df77d0b512d043019e9f6b0bc9 (patch) | |
tree | 1e1dfd404295e8a2a631ab8d7f7c1e3e9ee21b7d /django/db/backends/mysql/introspection.py | |
parent | d22b90b4eabc1fe9b7b35aada441e0edf5ebd6d8 (diff) | |
download | django-4fba321a457e52df77d0b512d043019e9f6b0bc9.tar.gz |
Fixed #29480 -- Made MySQL backend retrieve constraint columns in their defined order.
Diffstat (limited to 'django/db/backends/mysql/introspection.py')
-rw-r--r-- | django/db/backends/mysql/introspection.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py index 9520e890ea..56280b6fe5 100644 --- a/django/db/backends/mysql/introspection.py +++ b/django/db/backends/mysql/introspection.py @@ -160,6 +160,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): WHERE kc.table_schema = DATABASE() AND kc.table_name = %s + ORDER BY kc.`ordinal_position` """ cursor.execute(name_query, [table_name]) for constraint, column, ref_table, ref_column in cursor.fetchall(): |