-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
46 lines (34 loc) · 1000 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
create_migration:
# creates a new migration
migrate create -ext sql -dir db/migrations -seq $(name)
postgres_up:
# start postgres container.
docker compose up -d
postgres_down:
# stop postgres container
docker compose down
db_up:
docker exec -it pg_local createdb --username=root --owner=root fingreat
db_down:
docker exec -it pg_local dropdb --username=root fingreat
migrate_up:
# Make migration
migrate -path db/migrations -database "postgres://<user>:<password>@localhost:5432/fingreat?sslmode=disable" up
migrate_down:
# rollback migration
migrate -path db/migrations -database "postgres://<user>:<password>@localhost:5432/fingreat?sslmode=disable" down $(count)
download_deps:
# download dependencies
go mod download
sqlc:
# generate go sql
sqlc generate
start_prod:
# start server in prod
./fingreat
start_dev:
# start server
CompileDaemon -command="./fingreat"
test:
# run covrage test.[fix this]
go test -run github/tdadadavid/fingreat/backend/db/tests