Enum in migration not working (Postgres)
See original GitHub issueDescribe the bug A migration using enum type in postgres database isn’t working.
To Reproduce
- Create a migration with
table.enum('gender', ['male', 'female']) - Run migration
Expected behavior Constraint check is have to create normally.
Screenshots

What database are you using? Postgres
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Migration doesn't work when adding new value to enum and ...
Migration doesn't work when adding new value to enum and using new value as default, New enum values must be committed before they...
Read more >sqlalchemy postgresql enum does not create type on db migrate
I have a problem with postgresql enum type on db migrate/upgrade. I added a column "status" to model: class Banner(db.
Read more >Upgrading PostgreSQL's Enum type with SQLAlchemy using ...
In this tutorial we've successfully generated the migration file which can automatically upgrade enum types on PostgreSQL server. If you want to read...
Read more >Documentation: 15: 8.7. Enumerated Types - PostgreSQL
Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in...
Read more >Updating a Postgres Enum Column with a Laravel Migration
The enumerated data type (enum) provides a convenient way to constraint a column to a set of values. However, the implementation of enum...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Lastly we can also do this. This requires to smallest change:
This just requires adding
{column} INto the queryFixed in #363