jeffp / enumerated_attribute

Easy enum for your models, objects and views
MIT License
190 stars 63 forks source link

schema.rb is borked when enum is used #31

Open fringd opened 13 years ago

fringd commented 13 years ago

did add_column :interests, :status, :enum

migration ran, but got this in schema.rb where my table should have apeared:

# Could not dump table "interests" because of following StandardError
#   Unknown type 'enum' for column 'status'
fringd commented 13 years ago

I think the issue here is that add_column doesn't work... pulled the very very latest and used change_table instead. works fine.

sairam commented 13 years ago

change_table also gave me the same error.

yclian commented 12 years ago

The enumerated column attribute must be declared as a STRING in the database schema.

Take a look at your DB in what type it is stored. Mine (SQLite) is stored as an 'enum' and it went borked during a migration rollback.

Hand-fix the DB and use :string instead of :enum in migration (despite the code suggests to me that this is handled).