Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Zero downtime database changes

Plans schema changes and big backfills in expand and contract steps with lock limits, so production never freezes.

Claude's review

8/10 Strong zero downtime migration choreography with expand contract, lock timeouts, NOT VALID pattern and backfill rules.

We asked Claude the question you would ask: would I be glad I installed this? We only sell skills it rates 7 or higher.

In detail

Use when a schema change must ship without downtime — NOT NULL, rename, type change, or backfilling millions of live rows — for the expand-contract sequence and the lock/batching discipline that keeps each step from freezing prod. NOT lock internals or EXPLAIN (that is `postgresdb`), NOT drizzle-kit mechanics (that is `drizzle-orm`), NOT PITR (that is `backups`).

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: db-migrations
description: "Use when a schema change must ship without downtime — NOT NULL, rename, type change, or backfilling millions of live rows — for the expand-contract sequence and the lock/batching discipline that keeps each step from freezing prod. NOT lock internals or EXPLAIN (that is `postgresdb`), NOT drizzle-kit mechanics (that is `drizzle-orm`), NOT PITR (that is `backups`)."
tags: [migrations, zero-downtime, expand-contract, schema, backfill, ddl]
recommends: [postgresdb, drizzle-orm, backups, sql, planetscale]
origin: risco
---

# Database migrations without downtime

A production migration is a **sequence**, not a statement. The moment you treat `ALTER TABLE ... NOT NULL`
as one atomic change, you have already lost: the lock blocks every writer, the deploy that depends on the
new column races the deploy that still reads the old one, and a rollback means a second outage. Your job
is to decompose one risky change into a chain of small steps where **every intermediate state is
independently deployable** — the old app keeps working, the new app keeps working, and you can stop at any
point without an outage.

This skill is engine-neutral. It owns the *choreography* — what order to run things in and how to keep each
DDL from freezing the table — across Postgres, MySQL, and serverless variants, whatever runner you use
(Flyway, Alembic, golang-migrate, drizzle-kit, raw SQL).

## Route elsewhere

- Postgres lock internals, EXPLAIN/ANALYZE, indexing strategy, RLS, PgBouncer → `../postgresdb/SKILL.md`.
- Writing schema and running drizzle-kit specifically → `../drizzle-orm/SKILL.md`.
- PlanetScale deploy-request / branch cutover (Vitess online DDL) → `../planetscale/SKILL.md`.
- Creating/verifying backups, restore drills, PITR → `../backups/SKILL.md` (a migration *requires* a backup; making it lives there).
- Pure query logic — joins, windows, CTEs → `../sql/SKILL.md` (backfill batching is here; query correctness is there).

## Step 1 — Is this change online-safe in one step?

Most outages come from running a multi-step change as a single statement. Decide first:

| Change | One step? | Why |
|---|---|---|
| Add nullable column, no volatile default | Yes | Metadata-only on PG 11+/modern MySQL; no rewrite, no long lock. |
| Add column with a **constant** default | Yes (PG 11+) | Stored as a catalog default, no table rewrite. |
| Add column with a **volatile/expression** default | No | Rewrites every row under lock → expand-contract. |
| Add `NOT NULL` to existing/new column | No | Full-table validation scan under lock → add-nullable → backfill → validate. |
| Rename column / table | No | App reads the old name; needs dual-name window → expand-contract. |
...

From ericrisco's repository, MIT licence.

Related skills

  • Checked

    PostgreSQL schema explorer

    Explores an unfamiliar PostgreSQL database read only before writing SQL, so answers about your data are right.

    by timescale 1.9k
    7/101 credit
  • Checked

    HTTP API design review

    Designs or reviews HTTP endpoints, auth, pagination and versioning, so API changes do not break your clients.

    by AmazingAng 770
    7/101 credit
  • Checked

    Firebase Data Connect

    Builds and deploys Firebase Data Connect backends on PostgreSQL with secure queries and type safe SDKs.

    by firebase 533
    7/101 credit
  • Checked

    App performance tuning

    Measures first, then fixes slow pages, Core Web Vitals and N+1 database queries across your whole app.

    by addyosmani 122k
    7/101 credit
  • Checked

    Safe Postgres migrations

    Plans and tests PostgreSQL schema changes with lock levels in mind, so live tables change without downtime.

    by timescale 1.9k
    8/101 credit
  • Checked

    Supabase auth and database

    Builds with Supabase auth, database, storage and edge functions while avoiding common security traps.

    by supabase 3.2k
    8/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added