Skip to content

Instantly share code, notes, and snippets.

@brian-xu-vlt
Last active May 4, 2023 12:57
Show Gist options
  • Select an option

  • Save brian-xu-vlt/21f8703307c81c963d108bd4a4931bf9 to your computer and use it in GitHub Desktop.

Select an option

Save brian-xu-vlt/21f8703307c81c963d108bd4a4931bf9 to your computer and use it in GitHub Desktop.
dbsync/dbrestor
alias dbsync-clean-local='rm ~/CODE/dbsync/local-*.pgdump'
alias dbsync-clean-prod='rm ~/CODE/dbsync/production-*.pgdump'
alias dbsync-clean='dbsync-clean-local; dbsync-clean-prod'
alias dbsync-local-to-local='z infra && myke marketplace-local/db_dump && cp /tmp/marketplace-local.pgdump ~/CODE/dbsync/local-$(date +%F_%H-%M-%S).pgdump ; cd -'
alias dbsync-prod-to-local='z infra && myke marketplace-production/db_dump && cp /tmp/marketplace-production.pgdump ~/CODE/dbsync/production-$(date +%F_%H-%M-%S).pgdump ; cd -'
alias dbrestore-local-to-local='z infra && myke marketplace-local/db_restore_from_dump --PGDUMP_PATH=$(ls /Users/brian/CODE/dbsync/local* | sort | tail -1) ; cd -'
alias dbrestore-prod-to-local='z infra && myke marketplace-local/db_restore_from_dump --PGDUMP_PATH=$(ls /Users/brian/CODE/dbsync/production* | sort | tail -1) ; cd -'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment