alassek / activerecord-pg_enum

Integrate PostgreSQL's enumerated types with the Rails enum feature
MIT License
168 stars 10 forks source link

Support for renaming, removing enum values #10

Closed mockdeep closed 4 years ago

mockdeep commented 4 years ago

Thanks for this gem! It would be nice if this gem had support for renaming and removing enum values as well. It's rare for me to get things right the first time, so being able to easily change them later is pretty valuable.

It looks like on Postgres 10 and up renaming a value is relatively painless. Removing a value isn't directly supported, but it looks like there is a workaround that isn't too horrendous.

alassek commented 4 years ago

Hi @mockdeep, thanks for the feedback. Sorry it took so long for me to respond, I was on vacation.

I've just release v1.1.0, which adds rename_enum and rename_enum_value.

As for removing values, I've provided the necessary tools to do it but I'm not going to support data-munging directly. I don't want to be responsible for altering other people's business data.