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

scrub database dump: herokudump.py cmd #225

Open
wants to merge 1 commit into
base: ow/scrub-script-heroku-cli
Choose a base branch
from

Conversation

odo-sfct
Copy link
Collaborator

@odo-sfct odo-sfct commented Jun 9, 2024

Part 1 | Part 2 | Part 3

Run the command as:
heroku login
python manage.py herokudump iwalk-test
inside the server container with Django server up.
Where iwalk-test can be -staging or prod

It'll download the appropriate database and scrub it before restoring the local dump.
It works with you current as it runs a pg_restore with a clean, so it'll overwrite the data you have currently.
Best practice is do drop what you have locally first to get a clean slate, but it's been built so that it's not necessary.

There will be use cases where you would not want to scrub:

  • Testing specific migrations on exact emails/names
  • Running queries using those emails/names locally

Since that occasion is rarer, we leave that process to be manual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant