-
-
Notifications
You must be signed in to change notification settings - Fork 610
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Native enum migrations contain lower-cased values where they should be kept as specified and the migration accordingly fails.
Reproduction
I am creating migrations for models that contain native PostgreSQL enums.
Sometimes when a value is added - usually for the first value - the migration fails like this:
DriverException: alter type [...] add value if not exists 'NEW_VALUE' before 'old_value'; - "old_value" is not an existing enum label
The enum is actually uppercase for both the new and old values, so the error message is correct. For some reason the migration inserts a lower case value (but often only for the first old item).
export enum Test {
NEW_VALUE = "NEW_VALUE",
OLD_VALUE = "OLD_VALUE",
}
What driver are you using?
None
MikroORM version
6.4
Node.js version
22.0
Operating system
No response
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working