From 2b770cfdfc53a0ce46807649f5a001a1e6e523bc Mon Sep 17 00:00:00 2001 From: Diego Becciolini Date: Mon, 27 Apr 2026 11:06:55 +0100 Subject: [PATCH] ensure consistent ordering of PG enum values --- models/enumvalue.dbtpl.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/enumvalue.dbtpl.go b/models/enumvalue.dbtpl.go index 6b82571a..0bb2cf4d 100644 --- a/models/enumvalue.dbtpl.go +++ b/models/enumvalue.dbtpl.go @@ -22,7 +22,8 @@ func PostgresEnumValues(ctx context.Context, db DB, schema, enum string) ([]*Enu `JOIN ONLY pg_namespace n ON n.oid = t.typnamespace ` + `LEFT JOIN pg_enum e ON t.oid = e.enumtypid ` + `WHERE n.nspname = $1 ` + - `AND t.typname = $2` + `AND t.typname = $2 ` + + `ORDER BY e.enumsortorder` // run logf(sqlstr, schema, enum) rows, err := db.QueryContext(ctx, sqlstr, schema, enum)