split resetdb makefile target in downdb & updb

This commit is contained in:
Laurent Le Houerou 2024-03-21 17:56:06 +00:00
parent faa77e7970
commit 33f404fa20

View File

@ -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