-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
24 lines (23 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
createdb:
docker exec -it pgsql-dev createdb --username=postgres --owner=postgres gobank
dropdb:
docker exec -it pgsql-dev dropdb --username=postgres gobank
migrate_create:
migrate create -ext sql -dir database/migration --seq $(file)
migrateup:
migrate -database "postgres://postgres:secret@localhost:5432/gobank?sslmode=disable" -path database/migration up
migratedown:
migrate -database "postgres://postgres:secret@localhost:5432/gobank?sslmode=disable" -path database/migration down
migrateup_last:
migrate -database "postgres://postgres:secret@localhost:5432/gobank?sslmode=disable" -path database/migration up 1
migratedown_last:
migrate -database "postgres://postgres:secret@localhost:5432/gobank?sslmode=disable" -path database/migration down 1
sqlc:
sqlc generate
test:
go test -v -cover -short ./...
server:
go run main.go
mock:
mockgen -package mockdb -destination database/mock/store.go github.com/alansory/gobank/database/sqlc Store
.PHONY: createdb dropdb migrate_create migrateup migratedown migrateup_last migratedown_last sqlc test server mock