-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (30 loc) · 1.14 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
ifeq ($(APP_MODE), development)
-include .env
else
include .env
endif
export $(shell sed 's/=.*//' .env)
run:
go run cmd/main.go
build:
CGO_ENABLED=0 go build -o dist/app cmd/main.go
tidy:
go mod tidy
migrate-up:
migrate -path ./internal/db/postgresql/migration -database $(DB_CONNECTION_URL) -verbose up
migrate-down:
migrate -path ./internal/db/postgresql/migration -database $(DB_CONNECTION_URL) -verbose down
migrate-drop:
migrate -path ./internal/db/postgresql/migration -database $(DB_CONNECTION_URL) -verbose drop
migrate-up-test:
migrate -path ./internal/db/postgresql/migration -database $(DB_CONNECTION_TEST_URL) -verbose up
migrate-down-test:
migrate -path ./internal/db/postgresql/migration -database $(DB_CONNECTION_TEST_URL) -verbose down -all
migrate-drop-test:
migrate -path ./internal/db/postgresql/migration -database $(DB_CONNECTION_TEST_URL) -verbose drop
migrate-fresh: migrate-down migrate-up
generate-migration-file:
migrate create -ext sql -dir ./internal/db/postgresql/migration -seq $(table_name)
sqlc:
sqlc -f sqlc.yaml generate
.PHONY: migrate-up migrate-down sqlc migrate-fresh generate-migration-file run build