add goose

This commit is contained in:
2024-11-10 01:48:28 +07:00
parent 4a104923c7
commit 5567875910
3 changed files with 29 additions and 0 deletions
+11
View File
@@ -1,6 +1,17 @@
LOCAL_BIN := $(CURDIR)/bin
PATH := $(LOCAL_BIN):$(PATH)
ifeq (local-migrations-create,$(firstword $(MAKECMDGOALS)))
migrationName := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(migrationName):;@:)
endif
local-migrate-up:
@goose -allow-missing -dir ./migrations postgres "user=crab dbname=smm-core host=localhost port=5432 sslmode=disable" up
local-migrations-create:
@goose -dir ./migrations postgres "user=crab dbname=smm-core host=localhost port=5432 sslmode=disable" create "${migrationName}" sql
local-go-init: export GOBIN := $(LOCAL_BIN)
local-go-init:
go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway