From d313d4823e12344a53845611987d2c29cffc39cf Mon Sep 17 00:00:00 2001 From: i-norden Date: Fri, 7 Jan 2022 12:53:12 -0600 Subject: [PATCH] new make targets for running up migrations one at a time --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 6e8a377..c3203cb 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,11 @@ rollback: $(GOOSE) checkdbvars rollback_to: $(GOOSE) checkmigration checkdbvars $(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" down-to "$(MIGRATION)" +## Apply the next up migration +.PHONY: migrate_up_by_one +migrate_up_by_one: $(GOOSE) checkdbvars + $(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" up-by-one + ## Apply all migrations not already run .PHONY: migrate migrate: $(GOOSE) checkdbvars @@ -61,6 +66,11 @@ migrate: $(GOOSE) checkdbvars migrate_pre_batch_set: $(GOOSE) checkdbvars $(GOOSE) -dir db/pre_batch_processing_migrations postgres "$(CONNECT_STRING)" up +## Apply migrations to be ran after a batch processing, one-by-one +.PHONY: migrate_post_batch_set_up_by_one +migrate_post_batch_set_up_by_one: $(GOOSE) checkdbvars + $(GOOSE) -dir db/post_batch_processing_migrations postgres "$(CONNECT_STRING)" up-by-one + ## Apply migrations to be ran after a batch processing .PHONY: migrate_post_batch_set migrate_post_batch_set: $(GOOSE) checkdbvars