Last active
January 21, 2019 14:16
-
-
Save messanjah/e7580365f219e870df67 to your computer and use it in GitHub Desktop.
Steps to commit a cleanly merged db/structure.sql file
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 |
If tests are about to be run, rake test:prepare
might be needed too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works great. I also ran line 11 with a particular seed and there were no issues.