Ruby on Rails ActiveRecord Migrations Rollback migrations

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

To rollback the latest migration, either by reverting the change method or by running the down method. Run command:

5.0
rake db:rollback
5.0
rails db:rollback

Rollback the last 3 migrations

5.0
rake db:rollback STEP=3
5.0
rails db:rollback STEP=3

STEP provide the number of migrations to revert.

Rollback all migrations

5.0
rake db:rollback VERSION=0
5.0
rails db:rollback VERSION=0


Got any Ruby on Rails Question?