-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add make command to snapshot database. #1281
Add make command to snapshot database. #1281
Conversation
✅ Deploy Preview for galaxyng ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added possible suggestion
Makefile
Outdated
@@ -130,6 +130,19 @@ docker/resetdb: ## Cleans database | |||
./compose stop | |||
./compose run --rm api /bin/bash -c "./entrypoint.sh manage reset_db && django-admin migrate" | |||
|
|||
.PHONY: docker/db_snapshot | |||
NAME ?= galaxy | |||
docker/db_snapshot: ## Snapshot database. Example: make docker/db_snapshot NAME=my_special_backup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker/db_snapshot: ## Snapshot database. Example: make docker/db_snapshot NAME=my_special_backup | |
docker/db_snapshot: ## Snapshot database with optional NAME param. Example: make docker/db_snapshot NAME=my_special_backup |
Makefile
Outdated
|
||
.PHONY: docker/db_restore | ||
NAME ?= galaxy | ||
docker/db_restore: ## Restore database from a snapshot. Example: make docker/db_restore NAME=my_special_backup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
* Add make command to snapshot database. No-Issue
Usage:
make docker/db_snapshot
-> create a database dump and save it to db_snapshots/galaxy.backupmake docker/db_restore
-> restore the database from db_snapshots/galaxy.backupMultiple snapshots can be made by passing in
NAME=
make docker/db_snapshot NAME=pre-migration
-> creates db_snapshots/pre-migration.backupmake docker/db_restore NAME=pre-migration
-> restores db_snapshots/pre-migration.backupThis command was originally created to help debug the permissions to roles migration, however I have found it to be useful for cleaning up after tests run as well and wanted to share it.