모노레포 DB 마이그레이션 도우미. 사용법: /db-migrate {module} {description}. 모듈: fdd, kiis, im. 예: /db-migrate kiis add_reputation_index
모듈 및 설명: $ARGUMENTS (첫 번째 단어 = 모듈명, 나머지 = 마이그레이션 설명)
| Module | Working Dir | Command Prefix |
|---|---|---|
| fdd | fdd/backend | alembic |
| kiis | kiis | uv run alembic |
| im | im | alembic |
Steps:
docker compose ps db
If db is not running, start it: docker compose up -d db
Verify model registration: Check that all model files are imported in the module's models
__init__.pyGenerate migration:
cd {working_dir} && {command_prefix} revision --autogenerate -m "{description}"
Review: Display the generated migration file — show the upgrade() and downgrade() functions. Ask user to confirm before applying.
Apply migration:
cd {working_dir} && {command_prefix} upgrade head
cd {working_dir} && {command_prefix} current
Common issues: