Skip to content

Instantly share code, notes, and snippets.

@mediter
Created December 9, 2018 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mediter/47acf25da8e9fe6f1b244069e854c05b to your computer and use it in GitHub Desktop.
Save mediter/47acf25da8e9fe6f1b244069e854c05b to your computer and use it in GitHub Desktop.
[Rollback Migration] #migration #database #rails #ruby
rails db:rollback STEP=1
# Is a way to do this, if the migration you want to rollback is the last one applied. You can substitute 1 for however many migrations you want to go back.
# For example:
rails db:rollback STEP=5
# Will also rollback all the migration that happened later (4, 3, 2 and also 1).
# In order to rollback a specific migration use:
rails db:migrate:down VERSION=20100905201547
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment