Joined December 2013
·
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

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Mongoose 3
Have at least three original repos where Ruby is the dominant language

Charity
Fork and commit to someone's open source project in need

Mongoose
Have at least one original repo where Ruby is the dominant language
In ActiveRecord 2.4.1 there is native support for postgres enums. Maybe a little bit limited but works.