Last active
August 29, 2015 14:04
-
-
Save armstrongnate/a592b06e49f03dd0c468 to your computer and use it in GitHub Desktop.
Cherry pick a migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## One way to do it is from the rails console: | |
require 'db/migrate/MIGRATION_FILE_NAME.rb' | |
# if using def change | |
MigrationClass.new.migrate(:down) | |
# if using up or down | |
MigrationClass.up | |
## Another way is using a rake task | |
rake db:migrate:up VERSION=20090408054532 | |
# The second option is probably preferred because it updates the schema, however, | |
# it won't work if it has already behind or something. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment