Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider ordering enum labels based on the .NET label value instead of alphabetically #3398

Open
roji opened this issue Dec 5, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@roji
Copy link
Member

roji commented Dec 5, 2024

When we create enums in the database, we currently order the labels alphabetically. Since enum label ordering can be significant (one can sort by them, compare two enums...), it may be useful to preserve the .NET enum label value ordering when creating the PG enum.

Note that while PG allows inserting a new label after/before an existing label, it doesn't support reordering existing enum labels (or removing them). That means that if the .NET enum definition changes, we'll only be able to apply those changes when adding a new label.

Note also that this will cause a new migration to be created, as this will change the model.

@roji roji added the enhancement New feature or request label Dec 5, 2024
@roji roji added this to the Backlog milestone Dec 5, 2024
@roji roji self-assigned this Dec 5, 2024
@roji roji changed the title Consider ordering enum labels based on the .NET label ordering instead of alphabetically Consider ordering enum labels based on the .NET label value instead of alphabetically Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant