rake db:migrate
To revert back to the earlier version of database structures, just add VERSION= xxx to the back of the command. It becomes:
rake db:migrate VERSION=20090103162017
(this number "20090103162017" is the version number of the migration files generated by rake db:migrate. It is so simple.
else you can use
rake db:rollback
(this will rollback the last migration)
For more info, refer to http://guides.rubyonrails.org/migrations.html
No comments:
Post a Comment