Manage Phinx DB migrations up and down. Use when asked to "run phinx migrate", "rollback last migration", "check migration status", "apply one migration", or "run phinx with --count=1", "migrate up", "migrate down". Works together with the create-migration skill for creating migration files and with the pgtap skill for running tests.
The wrapper script for this skill is located in the same directory at ./scripts/phinx.sh (relative to this SKILL.md). To avoid ambiguity, use the explicit repository-root path when invoking it from automation or CI:
From the repository root:
cd ${workspace} # ensure you're at the repo root
./.github/skills/phinx/scripts/phinx.sh <command> [args...]
cd into the skill directory first:cd ${workspace}/.github/skills/phinx/scripts/ # ensure you're at the repo root
./phinx.sh <command> [args...]
phinx.php configuration (if present). It returns the underlying command's exit status../.github/skills/phinx/scripts/phinx.sh status
./.github/skills/phinx/scripts/phinx.sh migrate
./.github/skills/phinx/scripts/phinx.sh rollback
./.github/skills/phinx/scripts/phinx.sh path in automation to avoid invoking a different phinx binary that might be installed system-wide.This repository applies migrations one-at-a-time by default. Automated runs (including AI actors and CI) MUST invoke migrate with --count=1 unless the user explicitly requests applying multiple migrations at once.
Examples (repo root) — default, safe one-by-one migration:
./.github/skills/phinx/scripts/phinx.sh migrate --count=1
--count or set no --count at all to migrate all pending migrations; automation will then run exactly what the user specified.help: run ./.github/skills/phinx/scripts/phinx.sh to show wrapper helpmigrate: ./.github/skills/phinx/scripts/phinx.sh migrate — apply pending migrationsrollback: ./.github/skills/phinx/scripts/phinx.sh rollback — roll back last migrationstatus: ./.github/skills/phinx/scripts/phinx.sh status — show migration statusExamples above are copy-paste ready and unambiguous about the wrapper location.
create-migration skill, the workflow calls:
./.github/skills/phinx/scripts/phinx.sh migrate --count=1 — apply the new migration./.github/skills/phinx/scripts/phinx.sh rollback — verify down() reversibility (Step 7b)./.github/skills/phinx/scripts/phinx.sh migrate --count=1 — re-apply after down() checkup() fails, check status with status before retrying — do not retry the same broken migration.rollback fails after migration, the down() method has a bug and must be fixed before tests can run.create-migration skill workflow..github/skills/create-migration/SKILL.md for the full lifecycle including test authoring..github/skills/pgtap/SKILL.md for running those tests.