-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
29 lines (22 loc) · 838 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
DB_URL=postgresql://root:helloworld@localhost:5432/sharedboard?sslmode=disable
network:
docker network create trade-network
postgres:
docker run --name postgres --network trade-network -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=helloworld -d postgres:14-alpine
create_db:
docker exec -it postgres createdb --username=root --owner=root sharedboard
drop_db:
docker exec -it postgres dropdb sharedboard
migrate_up:
migrate -path db/migration -database "$(DB_URL)" -verbose up
migrate_down:
migrate -path db/migration -database "$(DB_URL)" -verbose down
sqlc:
sqlc generate
test:
go test -v -cover -short ./...
server:
go run main.go
mock:
mockgen -destination db/mock/store.go github.com/YuanData/SharedBoard/db/sqlc Store
.PHONY: network postgres create_db drop_db migrate_up migrate_down sqlc test server mock