From 33f404fa20606ab1a9ef2dd254c666fe7fccc959 Mon Sep 17 00:00:00 2001 From: Laurent Le Houerou Date: Thu, 21 Mar 2024 17:56:06 +0000 Subject: [PATCH] split resetdb makefile target in downdb & updb --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 452e84c..cd5a18f 100644 --- a/Makefile +++ b/Makefile @@ -22,12 +22,17 @@ clean: go clean rm -f $(BINARY_NAME) -resetdb: +downdb: goose -dir ./db/migrations postgres "host=$(DBHOST) port=$(DBPORT) user=$(DBUSER) password=$(DBPASS) dbname=$(DBNAME) sslmode=disable" down - goose -dir ./db/migrations postgres "host=$(DBHOST) port=$(DBPORT) user=$(DBUSER) password=$(DBPASS) dbname=$(DBNAME) sslmode=disable" up - goose -dir ./db/migrations postgres "host=$(DBHOST) port=$(DBPORT) user=$(DBUSER) password=$(DBPASS) dbname=$(DBNAME) sslmode=disable" status -.PHONY: build run clean ensure-bin-dir resetdb +updb: + goose -dir ./db/migrations postgres "host=$(DBHOST) port=$(DBPORT) user=$(DBUSER) password=$(DBPASS) dbname=$(DBNAME) sslmode=disable" up + +resetdb: + make downdb + make updb + +.PHONY: build run clean ensure-bin-dir resetdb downdb updb .DEFAULT_GOAL := all all: build run clean ensure-bin-dir