Previously rails 7.1
added
the support to add enums and drop the enums.
Now,
Rails 7.1 has
extended
the ability to rename an enum,
add enum value
and
rename enum value for the Postgres database adapter.
Before:
Before this change the only way to achieve renaming enum,
adding enum value or
renaming enum values was to use raw SQL statements.
Renaming the enum:
Adding a new enum value:
Renaming the enum value:
After:
After this change now it is easier to rename the enum,
add a new value
and
rename the enum value
Renaming the enum:
Adding a new enum value:
Renaming the enum value:
Record before:
Record after:
References:
Enum in PostgreSQL - https://www.postgresql.org/docs/current/datatype-enum.html