migrate
Installation
SKILL.md
/claude-db:migrate
Migration-safety lint, owned by module db-migration-safety (M22, axis performance) via the db-migration-safety / MSA checks. Default mode is read-only: it analyzes and explains, it does not run the migration.
$ARGUMENTS has two forms:
- single-file lint —
<migration-file|migration-dir> [flags]: parse and classify an existing migration (below). - diff mode —
<from-schema> <to-schema> [flags]: two schema paths. Runnode scripts/schema-diff.mjs --from <from-schema> --to <to-schema>to generate the up/down migration, then classify the generated migration exactly as in single-file mode.
If no argument is given, ask for one (or point at the project's migration directory).
Diff mode (<from-schema> <to-schema>)
- Run
node scripts/schema-diff.mjs --from <A> --to <B>to produce the up and down migration;schema-diff.mjsflags destructive steps. - Present the generated up/down migration to the user, with the plain-language summary of each step.
- Route every step
schema-diff.mjsflagged destructive (DROP TABLE/COLUMN, type narrowing) through the data-loss handshake below before anything is written. - Then classify the generated migration through the same lock/rewrite/reversibility analysis as single-file mode.