-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (23 loc) · 779 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
26
27
28
29
30
31
32
33
APP_NAME = server
# GOOSE PARAMETERS
GOOSE_DRIVER=mysql
GOOSE_DBSTRING="root:root1234@tcp(localhost:3306)/shopdevgo"
GOOSE_MIGRATION_DIR=./sql/schema
NAME_SQL ?= abc
dev:
go run ./cmd/${APP_NAME}/main.go
goose-create:
goose -s create $(NAME_SQL) sql -dir=$(GOOSE_MIGRATION_DIR)
goose-up:
goose $(GOOSE_DRIVER) $(GOOSE_DBSTRING) -dir=$(GOOSE_MIGRATION_DIR) up
# Migrate up a single migration from the current version
goose-up-by-one:
goose $(GOOSE_DRIVER) $(GOOSE_DBSTRING) -dir=$(GOOSE_MIGRATION_DIR) up-by-one
goose-down:
goose $(GOOSE_DRIVER) $(GOOSE_DBSTRING) -dir=$(GOOSE_MIGRATION_DIR) down
goose-reset:
goose $(GOOSE_DRIVER) $(GOOSE_DBSTRING) -dir=$(GOOSE_MIGRATION_DIR) reset
sqlcgen:
sqlc generate
swag:
swag init -g ./cmd/${APP_NAME}/main.go -o ./docs