add db connection, refactor code, add db migration files
This commit is contained in:
14
Makefile
14
Makefile
@@ -1,7 +1,17 @@
|
||||
-include .env
|
||||
|
||||
api/run:
|
||||
go run ./cmd/api -foundry_pass=${FOUNDRY_PASS} -foundry_host=${FOUNDRY_HOST} -port=${LISTEN_PORT}
|
||||
go run ./cmd/api -foundry_pass=${FOUNDRY_PASS} -foundry_host=${FOUNDRY_HOST} -port=${LISTEN_PORT} -log_level=${LOG_LEVEL} -db-dsn=${DB_DSN}
|
||||
|
||||
db/migration/new:
|
||||
@echo 'Creating migration files for ${name}...'
|
||||
migrate create -seq -ext=.sql -dir=./migrations ${name}
|
||||
|
||||
db/migrations/up:
|
||||
@echo 'Running up migrations...'
|
||||
migrate -path ./db/migrations -database ${DB_DSN} up
|
||||
|
||||
help:
|
||||
go run ./cmd/api -help
|
||||
go run ./cmd/api -help
|
||||
|
||||
.PHONY: run/api db/migration/new
|
||||
Reference in New Issue
Block a user