Skip to content

Slash command

Migration review

Reads a database migration before it runs and tells you which statement is the one that loses data.

About

Reads a database migration before it runs and tells you which statement is the one that loses data.

Files in v1.0.0

  • replicamd.plugin.json2430 B
  • skills/migrations-that-survive.md2653 B

Contributes

{
  "commands": [
    {
      "id": "review",
      "title": "Review the pending migration",
      "prompt": "Find the migration files added or changed in the working diff and read them as if they are about to run against production with real rows in the tables.\n\nFlag, with the exact statement:\n1. Anything that destroys data - DROP COLUMN, DROP TABLE, a type narrowing, a TRUNCATE, a DELETE without a WHERE.\n2. Anything that fails on existing rows - adding NOT NULL without a default, adding a UNIQUE constraint to a column with duplicates, a foreign key whose referenced rows may not exist.\n3. Anything that locks - a rewrite on a large table, an index built without CONCURRENTLY on Postgres, a column added with a volatile default on an older engine.\n4. Order problems - a backfill that runs before the column exists, or after the constraint that needs it.\n\nFor each one say what happens when it runs and what the safe version is: usually expand-migrate-contract across two deploys rather than one clever statement. Then check the down migration exists and actually reverses the up - a down that drops a column the up did not add is worse than no down at all.\n\nIf the migration is purely additive and safe, say that in one line."
    },
    {
      "id": "plan",
      "title": "Plan a zero-downtime column change",
      "prompt": "I want to change a column and I do not want downtime. Ask me which table and column and what the new shape is, then write the plan.\n\nUse expand-migrate-contract and be explicit about which deploy each step belongs to: add the new column nullable, ship code that writes both and reads the old, backfill in batches with the batch size and the pause between them, ship code that reads the new, then drop the old in a later deploy.\n\nSay which steps are reversible and which are not, and name the point of no return. Include the check that tells us the backfill finished - a count query, not a feeling."
    }
  ],
  "skills": [
    "skills/migrations-that-survive.md"
  ]
}

Versions

  • v1.0.07/26/2026 · 2 files

Install

Install in ReplicaMD

Nothing happened? ReplicaMD may not be installed yet - or open it first, then Settings → Plugins and install by id.

Plugin id:

migration-review

Bundle endpoint:

https://replicamd.nl/api/registry/plugins/migration-review/download
Author
Ardjun Debi - Tewarie @ardjun
Latest
v1.0.0
License
MIT
Installs
0
databasemigrationreviewsafety