Skip to content

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

Open
@roji

Description

@roji

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions