From 8809aa18cea2d278cf593217db36997483b7430b Mon Sep 17 00:00:00 2001 From: nochill Date: Wed, 20 Sep 2023 13:36:47 +0700 Subject: [PATCH] new command for refresh migration --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6db71db..edb7076 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,10 @@ migratedown: migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable" -verbose down $n migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}_test?sslmode=disable" -verbose down $n +migraterestart: + $(MAKE) migratedown + $(MAKE) migrateup + seed: ./import_csv.sh @@ -23,4 +27,4 @@ test: server: go run main.go -.PHONY: server migrateup migratedown sqlc \ No newline at end of file +.PHONY: server migrateup migratedown sqlc migraterestart \ No newline at end of file