|
@@ -1,20 +1,6 @@
|
|
include .env
|
|
include .env
|
|
|
|
|
|
-GOOSE_DB_STRING = "user=${DB_USER} password=${DB_PASSWORD} dbname=${DB_NAME} port=${DB_PORT} host=${DB_HOST} sslmode=disable"
|
|
|
|
-
|
|
|
|
-usage:
|
|
|
|
- @echo "make run"
|
|
|
|
- @echo "make test"
|
|
|
|
- @echo "make test-cover"
|
|
|
|
- @echo "make lint"
|
|
|
|
- @echo "make migration-status"
|
|
|
|
- @echo "make migration-up"
|
|
|
|
- @echo "make migration-down"
|
|
|
|
- @echo "make docker-build"
|
|
|
|
- @echo "make docker-up"
|
|
|
|
- @echo "make docker-down"
|
|
|
|
- @echo "make install-deps"
|
|
|
|
- @echo "make app-build"
|
|
|
|
|
|
+GOOSE_DB_STRING = ${DB_USER}:${DB_PASSWORD}@tcp\(${DB_HOST}:${DB_PORT}\)/${DB_NAME}
|
|
|
|
|
|
run:
|
|
run:
|
|
cd cmd/app && go run main.go
|
|
cd cmd/app && go run main.go
|
|
@@ -33,13 +19,16 @@ lint:
|
|
golangci-lint run --timeout=3m
|
|
golangci-lint run --timeout=3m
|
|
|
|
|
|
migration-status:
|
|
migration-status:
|
|
- goose -dir migrations postgres ${GOOSE_DB_STRING} status
|
|
|
|
|
|
+ goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} status
|
|
|
|
+
|
|
|
|
+migration-up-one:
|
|
|
|
+ goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} up-by-one
|
|
|
|
|
|
migration-up:
|
|
migration-up:
|
|
- goose -dir migrations postgres ${GOOSE_DB_STRING} up
|
|
|
|
|
|
+ goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} up
|
|
|
|
|
|
-migration-down:
|
|
|
|
- goose -dir migrations postgres ${GOOSE_DB_STRING} down
|
|
|
|
|
|
+migration-down-one:
|
|
|
|
+ goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} down
|
|
|
|
|
|
docker-build:
|
|
docker-build:
|
|
docker compose up --build --detach
|
|
docker compose up --build --detach
|