-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (19 loc) · 762 Bytes
/
Makefile
File metadata and controls
26 lines (19 loc) · 762 Bytes
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
APP_NAME = go-banking
ENTRY_POINT = cmd/api/main.go
MIGRATION_DIR = db/migrations
build:
@go build -o bin/${APP_NAME} ${ENTRY_POINT}
run: build
@./bin/go-banking
test:
@echo "Running tests"
@go test -v ./...
create-migrate:
@echo "Creating new migration: ${NAME}"
@migrate create -ext sql -dir ${MIGRATION_DIR} ${NAME}
migrate-up:
@migrate -database "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" -path ${MIGRATION_DIR} -verbose up
migrate-down:
@migrate -database "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" -path ${MIGRATION_DIR} -verbose down 1
force-version:
@migrate -database "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" -path ${MIGRATION_DIR} force ${VERSION}