2023-03-08 15:22:57 +07:00
|
|
|
include dev.env
|
2023-03-05 23:35:41 +07:00
|
|
|
|
|
|
|
migrateup:
|
|
|
|
migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable" -verbose up
|
|
|
|
|
|
|
|
migratedown:
|
|
|
|
migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable" -verbose down
|
|
|
|
|
2023-03-12 11:01:43 +07:00
|
|
|
mock-generate:
|
|
|
|
mockgen -package mockdb -destination db/mock/store.go git.nochill.in/nochill/naice_pos/db/sqlc Store
|
|
|
|
|
2023-03-05 23:35:41 +07:00
|
|
|
sqlc:
|
2023-03-13 09:24:59 +07:00
|
|
|
sqlc generate && make mock-generate
|
2023-03-05 23:35:41 +07:00
|
|
|
|
|
|
|
test:
|
|
|
|
go test -v -cover ./...
|
|
|
|
|
2023-03-07 18:52:37 +07:00
|
|
|
server:
|
2023-03-12 11:01:43 +07:00
|
|
|
go run main.go
|
2023-03-07 18:52:37 +07:00
|
|
|
|
|
|
|
.PHONY: server migrateup migratedown sqlc
|