2023-09-07 15:34:15 +07:00
|
|
|
include dev.env
|
|
|
|
|
|
|
|
migrateup:
|
|
|
|
migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable" -verbose up
|
2023-09-12 12:52:01 +07:00
|
|
|
migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}_test?sslmode=disable" -verbose up
|
2023-09-07 15:34:15 +07:00
|
|
|
|
|
|
|
migratedown:
|
|
|
|
migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable" -verbose down $N
|
2023-09-12 12:52:01 +07:00
|
|
|
migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}_test?sslmode=disable" -verbose down $N
|
|
|
|
|
|
|
|
seed:
|
|
|
|
./import_csv.sh
|
2023-09-07 15:34:15 +07:00
|
|
|
|
|
|
|
mock-generate:
|
2023-09-12 12:52:01 +07:00
|
|
|
mockgen -package mockdb -destination db/mock/store.go git.nochill.in/nochill/hiling_go/db/sqlc Store
|
2023-09-07 15:34:15 +07:00
|
|
|
|
|
|
|
sqlc:
|
|
|
|
sqlc generate && make mock-generate
|
|
|
|
|
|
|
|
test:
|
|
|
|
go test -v -cover ./...
|
|
|
|
|
|
|
|
server:
|
|
|
|
go run main.go
|
|
|
|
|
|
|
|
.PHONY: server migrateup migratedown sqlc
|