Skip to content

Commit 2693c86

Browse files
committed
Should keep the primary key column order
Fixes CI failure caused by rails#27961. https://travis-ci.org/rails/rails/jobs/201472146#L2390-L2409
1 parent a778a0d commit 2693c86

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ def primary_keys(table_name) # :nodoc:
441441
WHERE constraint_type = 'PRIMARY KEY'
442442
AND kcu.table_name = #{quote(name.identifier)}
443443
AND kcu.table_schema = #{name.schema ? quote(name.schema) : "ANY (current_schemas(false))"}
444+
ORDER BY kcu.ordinal_position
444445
SQL
445446
end
446447

0 commit comments

Comments
 (0)