Rod McLaughlin


What to do if one of your Rails migrations says 'unknown attribute' (19 feb 13)

e.g. "unknown attribute: password"

Run them twice:

rake db:migrate RAILS_ENV=test  
rake db:migrate RAILS_ENV=test 
rake db:migrate RAILS_ENV=development
rake db:migrate RAILS_ENV=development
rake db:migrate RAILS_ENV=production
rake db:migrate RAILS_ENV=production

This is to do with the mismatch between migrations and code changes. I really should try to write a solution to this problem.

http://rodmclaughlin.com/issues-with-migrations-in-ruby-on-rails



Back
Portland London