瀏覽代碼

Enforce ordering on PostgreSQL get_constraints cols (refs #21134)

Andrew Godwin 11 年之前
父節點
當前提交
59582a8119
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      django/db/backends/postgresql_psycopg2/introspection.py

+ 1 - 0
django/db/backends/postgresql_psycopg2/introspection.py

@@ -137,6 +137,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
             WHERE
                 kc.table_schema = %s AND
                 kc.table_name = %s
+            ORDER BY kc.ordinal_position ASC
         """, ["public", table_name])
         for constraint, column, kind, used_cols in cursor.fetchall():
             # If we're the first column, make the record