def up
add_enum_value :review_image_category, 'unknown'
end
def down
# there's no drop_enum_value
end
While Postgres indeed doesn't support ALTER TYPE DROP VALUE it does support ALTER TYPE ADD VALUE IF NOT EXISTS. Is this somehow accessible from the gem? An :if_not_exists parameter would be helpful.
When I rollback and migrate again a migration that adds an enum value, I get an error:
ActiveRecord::StatementInvalid: PG::DuplicateObject: ERROR: enum label "unknown" already exists
This is my migration:
While Postgres indeed doesn't support
ALTER TYPE DROP VALUE
it does supportALTER TYPE ADD VALUE IF NOT EXISTS
. Is this somehow accessible from the gem? An:if_not_exists
parameter would be helpful.