From 4699385a217ff2cea7e0ae956087d93f8987ac90 Mon Sep 17 00:00:00 2001 From: i-norden Date: Mon, 10 Jan 2022 12:13:37 -0600 Subject: [PATCH] new make targets for rolling back pre and post-batch migrations --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c2dc144..700a838 100644 --- a/Makefile +++ b/Makefile @@ -48,12 +48,23 @@ rollback: $(GOOSE) checkdbvars $(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" down pg_dump -O -s $(CONNECT_STRING) > schema.sql - ## Rollback to a select migration (id/timestamp) .PHONY: rollback_to rollback_to: $(GOOSE) checkmigration checkdbvars $(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" down-to "$(MIGRATION)" +## Rollback pre_batch_set +.PHONY: `rollback_pre_batch_set` +rollback_pre_batch_set: $(GOOSE) checkdbvars + $(GOOSE) -dir db/pre_batch_processing_migrations postgres "$(CONNECT_STRING)" down + pg_dump -O -s $(CONNECT_STRING) > schema.sql + +## Rollback post_batch_set +.PHONY: rollback_post_batch_set +rollback_post_batch_set: $(GOOSE) checkdbvars + $(GOOSE) -dir db/post_batch_processing_migrations postgres "$(CONNECT_STRING)" down + pg_dump -O -s $(CONNECT_STRING) > schema.sql + ## Apply the next up migration .PHONY: migrate_up_by_one migrate_up_by_one: $(GOOSE) checkdbvars