Joined December 2013
·

Paweł

Poland
·
·

Posted to Postgres Enum Type in Rails 4 over 1 year ago

In ActiveRecord 2.4.1 there is native support for postgres enums. Maybe a little bit limited but works.

Posted to Postgres Enum Type in Rails 4 over 1 year ago

Any advices on creating migration file? I've did it this way:

 create_table :messages do |t|
   #...
   t.column :direction, :message_direction
   #...
end

And everything seems fine, but I got such comment in my schema file:

# Could not dump table "messages" because of following StandardError
#   Unknown type 'message_direction' for column 'direction'

Any ideas to fix it? Did I write correct migration file?

Achievements
38 Karma
0 Total ProTip Views