34 lines
649 B
Makefile
34 lines
649 B
Makefile
|
.ONESHELL:
|
||
|
|
||
|
export PATH := $(shell pwd)/bin:$(shell pwd)/web/node_modules/.bin:$(PATH)
|
||
|
export GOOSE_DRIVER=sqlite3
|
||
|
export GOOSE_DBSTRING=./data.db
|
||
|
export GOOSE_MIGRATION_DIR=schemas/migrations
|
||
|
|
||
|
build: generate-go generate-web
|
||
|
go build -o bin/bluemage ./go/cmd/bluemage/main.go
|
||
|
|
||
|
generate-go:
|
||
|
rm -rf go/gen
|
||
|
cd ./schemas/proto
|
||
|
buf generate --template buf.gen.go.yaml .
|
||
|
|
||
|
generate-web:
|
||
|
rm -rf web/gen
|
||
|
cd ./schemas/proto
|
||
|
buf generate --template buf.gen.web.yaml .
|
||
|
|
||
|
migrate:
|
||
|
@goose up
|
||
|
|
||
|
migrate-new:
|
||
|
@read -p "Name new migration: " name
|
||
|
if [[ $$name ]]; then goose create "$$name" sql; fi
|
||
|
|
||
|
migrate-redo:
|
||
|
@goose redo
|
||
|
|
||
|
migrate-down:
|
||
|
@goose down
|
||
|
|