Last active
December 20, 2018 23:08
-
-
Save chrisarevir/6e794e24f298ad92e214446988b1f771 to your computer and use it in GitHub Desktop.
Reset for Rails DB
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
Dealing with conflicts to db/structure.sql (when merging master) | |
$ git checkout master | |
# Change database.yml to point to database: clean (on localhost) in development env | |
# In one command: | |
# 1) drops the database specified in database.yml for current env ('clean' database) | |
# 2) creates a db with name specified in database.yml | |
# 3) loads master's structure into the database specified in database.yml | |
$ bin/rake db:drop db:create db:structure:load | |
# Checkout your branch | |
$ git pull origin master | |
$ bin/rake db:migrate -- may need to comment out migration code that relies on data but does not change the schema | |
# commit and push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment