I have a Users model which needs an :email
column (I forgot to add that column during the initial scaffold).
I opened the migration file and added
You can also do
rake db:rollback
if you have not added any data to the tables.Then edit the migration file by adding the email column to it and then call
rake db:migrate
This will work if you have rails 3.1 onwards installed in your system.
Much simpler way of doing it is change let the change in migration file be as it is. use
$rake db:migrate:redo
This will roll back the last migration and migrate it again.