-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (24 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
postgres:
docker run --name ps_name -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:latest
createdb:
docker exec -it ps_name createdb --username=root --owner=root gopherbank
dropdb:
docker exec -it ps_name dropdb gopherbank
migrateup:
migrate -path db/migration -database "postgresql://root:secret@localhost:5432/gopherbank?sslmode=disable" -verbose up
migrateup_user:
migrate -path db/migration -database "postgresql://root:secret@localhost:5432/gopherbank?sslmode=disable" -verbose up 1
migratedown:
migrate -path db/migration -database "postgresql://root:secret@localhost:5432/gopherbank?sslmode=disable" -verbose down
migratedown_user:
migrate -path db/migration -database "postgresql://root:secret@localhost:5432/gopherbank?sslmode=disable" -verbose down 1
sqlc:
sqlc generate
# to run unit test in complete project
test:
go test -v -cover ./...
server:
go run main.go
# .PHONY is a way to ensure that Make knows when a target is not meant to produce a file but
# rather execute specific commands or recipes.
.PHONY: postgres createdb dropdb migrateup migratedown sqlc test server migrateup_user migratedown_user