-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (30 loc) · 1.01 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
export PORT := 8081
export _MIGRATION_DIR := db/migrations
export _MIGRATION_DB_PATH := postgresql://postgres:postgres@localhost:5433/sandbox?sslmode=disable
run:
go run ./cmd/api
dev:
go run ./cmd/api -dev
devw:
reflex -r '\.go$$' -s make dev
postgres:
docker-compose up -d
sqlboiler:
go generate
seed:
go run ./cmd/seed -dev
resetdb:
migrate -path $(_MIGRATION_DIR) -database $(_MIGRATION_DB_PATH) -verbose drop -f && make migrateup && make seed
migrateup:
migrate -path $(_MIGRATION_DIR) -database $(_MIGRATION_DB_PATH) -verbose up
migrateup1:
migrate -path $(_MIGRATION_DIR) -database $(_MIGRATION_DB_PATH) -verbose up 1
migratedown:
migrate -path $(_MIGRATION_DIR) -database $(_MIGRATION_DB_PATH) -verbose down
migratedown1:
migrate -path $(_MIGRATION_DIR) -database $(_MIGRATION_DB_PATH) -verbose down 1
migrateredo:
make migratedown1 && make migrateup1
test:
go test -v -cover ./...
.PHONY: run dev devw postgres sqlboiler seed resetdb migratedown migratedown1 migrateup migrateup1 migrateredo test