Hello, So I’m adding a Postgres Enum Type with a migration but I’m having a problem with db/schema.rb output breaking when I do this:
def up execute <<-SQL.squish CREATE TYPE three_letters_type AS ENUM ( ‘A’, ‘B’, ‘C’, ); SQL execute <<-SQL.squish ALTER TABLE test ADD COLUMN three_letters three_letters_type; SQL end
``
I end up with the following comments in db/schema.rb -
Could not dump table “test” because of following StandardError
Unknown type ‘three_letters_type’ for column ‘three_letters’
``
It’s quite important for me to be able to use Enums because unique-indexes across several columns are expensive and it’s highly preferable not to use t.string (varchar) here. Would be great to hear if there is a work-around for this, thanks.