aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2017-02-14 08:11:08 -0500
committerGitHub <noreply@github.com>2017-02-14 08:11:08 -0500
commite9949265d9fb6e20aa4c73f189147812db377edc (patch)
tree8ec6e460e24f8aabc20cb66c69ab5de4e8031485 /activerecord/lib
parenta778a0d91fd662d5efa8e548c40b6c79f7e921fc (diff)
parent2693c860902aa16029324c16c98739b3dafd23eb (diff)
downloadrails-e9949265d9fb6e20aa4c73f189147812db377edc.tar.gz
rails-e9949265d9fb6e20aa4c73f189147812db377edc.tar.bz2
rails-e9949265d9fb6e20aa4c73f189147812db377edc.zip
Merge pull request #27997 from kamipo/should_keep_pk_column_order
Should keep the primary key column order
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
index 863a0dd997..a61d920a73 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
@@ -441,6 +441,7 @@ module ActiveRecord
WHERE constraint_type = 'PRIMARY KEY'
AND kcu.table_name = #{quote(name.identifier)}
AND kcu.table_schema = #{name.schema ? quote(name.schema) : "ANY (current_schemas(false))"}
+ ORDER BY kcu.ordinal_position
SQL
end