1
0
Fork 0
This repository has been archived on 2025-09-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-yggdrasil/Makefile

36 lines
973 B
Makefile

.PHONY: codegen
codegen:
@echo "Generating code..."
@oapi-codegen --config=./oapi-codegen.cli.yaml ./api/v1/openapi.yaml
POSTGRES_URL="pgx5://yggdrasil_user:yggdrasil@localhost:5432/yggdrasil?sslmode=disable"
.PHONY: create-migration
create-migration:
migrate create -ext sql -dir ./migrations -seq -digits 3 ${name}
.PHONY: local-migrate-up
local-migrate-up:
migrate -database ${POSTGRES_URL} -path ./migrations up
.PHONY: local-migrate-force
local-migrate-force:
migrate -database ${POSTGRES_URL} -path ./migrations force
.PHONY: local-migrate-down
local-migrate-down:
migrate -database ${POSTGRES_URL} -path ./migrations down
.PHONY: local-migrate-drop
local-migrate-drop:
migrate -database ${POSTGRES_URL} -path ./migrations drop -f
.PHONY: local-db-seed
local-db-seed:
@echo "Seeding database..."
@APP_ENV="development" DATABASE_URL_FILE="secrets/postgres_url" go run ./cmd/seed/main.go
.PHONY: test
test:
@echo "Running tests..."
@go test -v ./...