migration-checklisted
Install: claude install-skill atretyak1985/swarmery
# Purpose
Validate database migration safety and schema consistency for the project's PostgreSQL database. Check migration SQL files for safety issues, verify alignment between the migration-managed schema, the ORM schema in the main app (project.json -> `mainApp`), and Zod/DTO validation types consumed by route handlers. Examples below use Flyway-style migrations and Drizzle ORM -- adapt to the project's actual tools (`CLAUDE.md`, project.json -> `stack.db`). For post-incident SQL data fixes that need to be captured as migrations, see `infrastructure-as-code` skill. For field-level alignment between the ORM, Zod, and route handler inputs beyond what this skill covers, see `api-contract`.
DO NOT use Java Entity terminology anywhere in reports or output unless the project actually has Java services. The TypeScript validation layer is called "Zod/DTO".
# When to use
- Reviewing new migration SQL files before applying
- Checking alignment between SQL migrations and the ORM schema after a schema change
- Validating migration safety (reversibility, index concurrency, NOT NULL defaults)
- Detecting drift between the database schema and TypeScript Zod/DTO types in the main app
- Pre-deploy migration review as part of a release checklist
# When NOT to use
- Deployment config validation or deploying -- use `deployment`
- Identity-provider database issues (e.g., an IdP's own `user_access` schema) -- use the auth-domain skill
- IaC config drift or post-incident capture -- use `inf