Skip to content

Ensure consistent ordering of Postgres enum values#430

Open
itizir wants to merge 1 commit into
xo:mainfrom
itizir:patch-1
Open

Ensure consistent ordering of Postgres enum values#430
itizir wants to merge 1 commit into
xo:mainfrom
itizir:patch-1

Conversation

@itizir

@itizir itizir commented Apr 27, 2026

Copy link
Copy Markdown

Closes #429.

As discussed in the issue above, Postgres does not guarantee the ordering of enum values returned by the query in models/enumvalue.dbtpl.go: the migrations leading the the final schema may leave those rows in different orders.

An explicit ordering in the statement ensures that regardless of the history and state of the internal pg_type table, the output is always consistent for a given schema.

The output from dbtpl may be different after this change gets introduced, but it would then remain consistent afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PG enum values ordering not stable

1 participant