-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (29 loc) · 1.05 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
DB_URL=postgresql://root:secret@localhost:5432/filemanager?sslmode=disable
postgres:
docker run --name postgres -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:14-alpine
createmigrateinitschema:
migrate create -ext sql --dir db/migrations --seq init_schema
new_migration:
migrate create -ext sql -dir db/migrations -seq $(name)
createdb:
docker exec -it postgres createdb --username=root --owner=root filemanager
dropdb:
docker exec -it postgres dropdb filemanager
sqlc:
sqlc generate
server:
go run main.go
test:
go test -v -cover ./db/sqlc ./api ./token
testmail:
go test -v -cover ./email
migrateup:
migrate -path db/migrations -database "$(DB_URL)" -verbose up
mock:
mockgen -package mockdb -destination db/mock/store.go github.com/SabariGanesh-K/21BPS1209_Backend.git/db/sqlc Store
redis:
docker run --name redis -p 6379:6379 -d redis:7-alpine
launch:
docker start postgres
docker start redis
.PHONY: postgres new_migration createdb dropdb migrateup createmigrateinitschema sqlc mock test redis testmail launch