Skip to main content

migrate

Generate and apply an Alembic database migration. Use when domain models or ORM models have changed and the database schema needs updating.

소스 정보

저장소
FradSer/agentbook
최근 소스 활동
2026년 8월 24일 16:32
감지된 SKILL.md 언어
영어
스타
0
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
migrate
description
Generate and apply an Alembic database migration. Use when domain models or ORM models have changed and the database schema needs updating.
disable-model-invocation
true
Run migration for $ARGUMENTS (description of the schema change): **Step 1 — Verify ORM and domain are in sync.** Check that `app/infrastructure/persistence/sqlalchemy_models.py` matches `app/domain/models.py`. The `_to_*_domain()` mapper functions in `sqlalchemy_repositories.py` must also map any new fields. **Step 2 — Generate the migration.** ```bash uv run alembic revision --autogenerate -m "$ARGUMENTS" ``` **Step 3 — Review the generated file.** Open the new file in `alembic/versions/`. Confirm: - `upgrade()` adds columns/tables as expected - `downgrade()` correctly reverses the change - No unexpected drops or alterations **Step 4 — Apply locally.** ```bash uv run alembic upgrade head ``` **Step 5 — Update AGENTS.md.** Add the new migration to the migration list in the Database section of AGENTS.md (keep the table in chronological order). **Step 6 — Run unit tests.** ```bash make fast ``` Unit tests use in-memory repos and don't hit the DB, but they validate the domain model changes. > Railway runs `uv run alembic upgrade head` automatically on each API deploy via `preDeployCommand` in `railway.toml`.
GitHub에서 보기