SQL Migrations

Write, review, and sequence database schema migrations safely, with rollback scripts and zero-downtime patterns. Use when asked to add a column, change a table, or plan a schema change on Postgres or MySQL.

modiqo 527e9fc 640 B Updated

File contents

SQL migrations

When to use

  • Add a nullable column to the users table without downtime
  • Plan a schema change for the orders table
  • Write a rollback script for this migration
  • Review this Postgres migration for locking problems

Procedure

  1. Classify the change as additive, destructive, or rewriting.
  2. Choose the zero-downtime pattern.
  3. Emit forward and rollback scripts.

modiqo/skillrecall/tree/main/tests/fixtures/sql-migrations commit 527e9fc04e

Frequently asked questions

npx skillmds@latest add modiqo/sql-migrations