1
0
mirror of https://github.com/django/django.git synced 2024-12-22 09:05:43 +00:00

Fixed #29480 -- Made MySQL backend retrieve constraint columns in their defined order.

This commit is contained in:
Thomas Grainger 2018-06-29 15:43:53 +01:00 committed by Tim Graham
parent d22b90b4ea
commit 4fba321a45

View File

@ -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():