According to this answer, I have to run a raw query if I want to update an enum
in MySQL. But with PostgreSQL, I can't use this query, and enum type for PostgreSQL in Laravel seems strange.
Is there any way to update enum in a migration for postgreSQL ?
Laravel use constraint on
character varying
forenum
.Assuming there is a table
mytable
with an enum columnstatus
, we have to drop the constraint (named tablename_columnname_check) then add it in a migration like this:It solves the problem, hope it can help!