22# Environment Configuration
33# -------------------------------
44MIGRATIONS_PATH = ./cmd/migrate/migrations
5- ENV ?= staging # Default to staging if not specified
5+ ENV ?= development # Default to development if not specified
66
77# Debug output showing which environment is being loaded
88$(info Loading $(ENV) environment...)
@@ -11,15 +11,18 @@ $(info Loading $(ENV) environment...)
1111ifeq ($(ENV ) ,prod)
1212include .env.prod
1313$(info Using production database configuration)
14- else
14+ else ifeq ($(ENV),staging)
1515include .env.staging
1616$(info Using staging database configuration)
17+ else
18+ include .env.development
19+ $(info Using development database configuration)
1720endif
1821
1922# -------------------------------
2023# Migration Targets
2124# -------------------------------
22- .PHONY : migrate-create
25+ .PHONY : migration
2326migration :
2427 @migrate create -seq -ext sql -dir $(MIGRATIONS_PATH ) $(filter-out $@ ,$(MAKECMDGOALS ) )
2528
@@ -52,6 +55,14 @@ staging-up:
5255staging-down :
5356 @$(MAKE ) migrate-down ENV=staging
5457
58+ .PHONY : dev-up
59+ dev-up :
60+ @$(MAKE ) migrate-up ENV=development
61+
62+ .PHONY : dev-down
63+ dev-down :
64+ @$(MAKE ) migrate-down ENV=development
65+
5566# -------------------------------
5667# Other Commands
5768# -------------------------------
@@ -75,4 +86,4 @@ gen-docs:
7586show-env :
7687 @echo " Current Environment: $( ENV) "
7788 @echo " DB Connection: $( DB_ADDR_NO_POOL) "
78- @echo " Migrations Path: $( MIGRATIONS_PATH) "
89+ @echo " Migrations Path: $( MIGRATIONS_PATH) "
0 commit comments