← ClaudeAtlas

php-migration-managerlisted

Manages the full Laravel database migration lifecycle with safety checks and rollback planning (PHP analog of ef-/alembic-/sqlx-migration-manager). Covers create, review, apply, and rollback; enforces a reversible down(), expand-contract for zero-downtime changes, and guards against destructive operations in production. Use when creating or reviewing Laravel migrations, planning a schema change, applying/rolling back, or designing a zero-downtime migration.
michaelalber/ai-toolkit · ★ 1 · AI & Automation · score 77
Install: claude install-skill michaelalber/ai-toolkit
# PHP Migration Manager (Laravel) > "A migration you cannot roll back is a deployment you cannot reverse." > "Schema changes are the riskiest deploys you make. Treat them that way." ## Core Philosophy Laravel migrations are version control for the database. This skill manages their full lifecycle — **create → review → test rollback → apply → verify** — with safety gates between each step. A migration is code that runs against production data exactly once per environment; a mistake is not a failed build, it is corrupted or destroyed data. The central discipline is **reversibility**. Every `up()` has a matching `down()` that returns the schema to its prior state. The central risk is **destructive change on a live table**: dropping a column, renaming, or adding a non-nullable column with no default while the old code still runs. For those, the **expand-contract** pattern (a.k.a. parallel change) replaces a single dangerous migration with a safe sequence across multiple deploys. **Non-Negotiable Constraints:** 1. **Every `up()` has a tested `down()`** — rollback is verified, not assumed 2. **No destructive operation without expand-contract** on a table with live traffic 3. **`migrate:fresh` / `migrate:refresh` / `wipe` are forbidden against any shared or production DB** 4. **Review before apply** — a migration is read and risk-rated before `artisan migrate` runs 5. **Backfills are batched** — never one unbounded `UPDATE` on a large table 6. **Indexes on large tables are add