1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #43371 from rails/fix_postgresql_14_tests

Specify ORDER BY enumsortorder for postgres enums
This commit is contained in:
John Hawthorn 2021-10-04 12:03:08 -07:00 committed by GitHub
commit 766b84dfe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -459,7 +459,7 @@ module ActiveRecord
query = <<~SQL query = <<~SQL
SELECT SELECT
type.typname AS name, type.typname AS name,
string_agg(enum.enumlabel, ',') AS value string_agg(enum.enumlabel, ',' ORDER BY enum.enumsortorder) AS value
FROM pg_enum AS enum FROM pg_enum AS enum
JOIN pg_type AS type JOIN pg_type AS type
ON (type.oid = enum.enumtypid) ON (type.oid = enum.enumtypid)