add categories table and local env

This commit is contained in:
2024-11-18 20:29:45 +07:00
parent 9a51201678
commit 6cfab72b9c
8 changed files with 65 additions and 6 deletions
+13 -1
View File
@@ -7,11 +7,22 @@ ifeq (local-migrations-create,$(firstword $(MAKECMDGOALS)))
endif
local-migrate-up:
@goose -allow-missing -dir ./migrations postgres "user=crab dbname=smm-core host=localhost port=5432 sslmode=disable" up
@goose -allow-missing -dir ./migrations postgres "user=crab password=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-up:
docker-compose -f docker-compose-local.yml up -d --force-recreate --build
local-down:
docker-compose -f docker-compose-local.yml down
local-wait_db:
timeout 10s bash -c "until docker exec db pg_isready; do sleep 1; done"
local-restart: local-down local-up local-wait_db local-migrate-up
local-go-init: export GOBIN := $(LOCAL_BIN)
local-go-init:
go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
@@ -23,6 +34,7 @@ local-go-init:
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install github.com/pressly/goose/v3/cmd/goose@latest
generate:
rm -rf proto resources