You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use alternative ADD VALUE syntax when adding a new value to enum #10955
When changing a new enum value is added TypeORM currently generates lengthy migration that:
renames the current enum type
creates new enum type with new values
changes the type of column to the new enum type casting values to string then to the target enum type
drops the now old enum type
This is a valid way to change enum type but it's pretty dangerous on big tables. The type change locks the whole table and the type casing basically causes update on the whole table which can take a while so as the result this migration can lock up big tables.
You can add new values to enum type by simply running:
ALTER TYPE name ADD VALUE 'value'
TypeORM could detect that the new enum only contains new values and use this alternative way which doesn't cause any locking and is instant even on big tables.
Considered Alternatives
Not many alternatives to this, the current implementation is correct.
Additional Context
I have PR ready, coming soon
Relevant Database Driver(s)
aurora-mysql
aurora-postgres
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
spanner
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
TypeORM has returned to active development after recently transitioning to new leadership (see related announcement).
As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues.
🧹 This issue is being automatically closed because it has had no activity in the last 6 months.
If you believe this issue is still relevant, feel free to comment below and the maintainers may reopen it. Thank you for your contribution.
Activity
feat: Use ADD VALUE for new enum values
feat: Use ADD VALUE for new enum values
feat: Use ADD VALUE for new enum values
feat: Use ADD VALUE for new enum values
github-actions commentedon Sep 18, 2025
TypeORM has returned to active development after recently transitioning to new leadership (see related announcement).
As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues.
🧹 This issue is being automatically closed because it has had no activity in the last 6 months.
If you believe this issue is still relevant, feel free to comment below and the maintainers may reopen it. Thank you for your contribution.
bmbferreira commentedon Sep 19, 2025
this is still relevant and should not be closed