-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
25 lines (17 loc) · 918 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
MIGRATION = ""
gen-proto:
protoc --proto_path=protoc --go_out=./pb --go_opt=paths=source_relative --go-grpc_out=./pb --go-grpc_opt=paths=source_relative protoc/**/v1/*.proto
test:
go test -v ./...
gen-schema:
sqlboiler mysql -c database.toml -o ./internal/adaptor/repository/mysql/shcema -p schema --no-tests --wipe
gen-migration:
migrate create -ext sql -dir ./db/migration -seq ${MIGRATION}
migrate-up:
migrate --path db/migration --database "mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST}:${MYSQL_PORT})/${MYSQL_DATABASE}" --verbose up
migrate-down:
migrate --path db/migration --database "mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST}:${MYSQL_PORT})/${MYSQL_DATABASE}" --verbose down
migrate-drop:
migrate --path db/migration --database "mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST}:${MYSQL_PORT})/${MYSQL_DATABASE}" --verbose drop
run:
go run cmd/server/main.go