Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup reform_style removal and 738 migrations #744

Merged
merged 1 commit into from
Nov 21, 2017

Conversation

hdoupe
Copy link
Collaborator

@hdoupe hdoupe commented Nov 20, 2017

Resolves #743

@hdoupe
Copy link
Collaborator Author

hdoupe commented Nov 21, 2017

This PR involves no change in logic. It removes migrations added in PR #738 and adds them in a cleaner manner. Also, it adds the remove reform_style file in the exact same format as it is in the Heroku app databases.

This was tested locally with the following commands:

mkdir db_problem
cd db_problem/
git clone https://github.com/OpenSourcePolicyCenter/PolicyBrain
cd PolicyBrain/
git checkout v1.1.1 -b v1.1.1a
pushd deploy/ && ./install_taxbrain_server.sh && popd && source activate aei_dropq
python manage.py makemigrations
python manage.py migrate
git checkout -b v1.1.1b
echo replaced by identical file
rm webapp/apps/taxbrain/migrations/0055_remove_taxsaveinputs_reform_style.py
git pull origin pull/744/head:cleanup_738_migrations
source deactivate
conda env remove --name aei_dropq && pushd deploy/ && ./install_taxbrain_server.sh && popd && source activate aei_dropq
python manage.py makemigrations
python manage.py migrate

One more note to those who don't already know this: You really must include migration files in your pull requests. There are three databases that need to stay in sync: whatever you're running locally, the test database, and the production database. Using a common set of migration files helps to do this.

For more info see: https://www.algotech.solutions/blog/python/django-migrations-and-how-to-manage-conflicts/

@hdoupe
Copy link
Collaborator Author

hdoupe commented Nov 21, 2017

I was able to successfully deploy this PR to the test server and run the migrations.

@hdoupe hdoupe merged commit da62851 into ospc-org:master Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants