undo migration ruby on rails code example
Example 1: rails rollback multiple migrations
rake db:rollback STEP=n
# n = how many migrations you want to rollback
Example 2: rials db down
bin/rails db:migrate:down VERSION=YYYYMMDDHHMMSS
rake db:rollback STEP=n
# n = how many migrations you want to rollback
bin/rails db:migrate:down VERSION=YYYYMMDDHHMMSS