zero-downtime-migrations

Automate zero-downtime database schema migrations for PostgreSQL and MySQL.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/marquesfelip/agents-and-skills --skill zero-downtime-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zero-downtime-migrations
Source: https://github.com/marquesfelip/agents-and-skills/tree/main/skills/zero-downtime-migrations
Command: npx skills add https://github.com/marquesfelip/agents-and-skills --skill zero-downtime-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables safe, zero-downtime database schema evolution in production, avoiding long locks and service disruption.

Core Features & Use Cases

  • Expand-Contract pattern guidance to rename columns, change types, and remove elements across rolling deployments
  • Safe, non-blocking DDL strategies with phased deployment sequencing and backfill best practices
  • Tooling and workflow recommendations for PostgreSQL and MySQL (gh-ost, pt-online-schema-change, pg_repack) with safe cutover patterns
  • Real-world use cases: blue/green deployments, canary rollouts, and multi-tenant schemas with high uptime requirements

Quick Start

Plan a phased migration and validate with a canary before final cutover.

Frequently Asked Questions about zero-downtime-migrations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy database schema changes without downtime in PostgreSQL?

Renaming columns or changing types without downtime requires the expand-contract pattern, where you expand the schema with new columns, backfill data, and contract old columns across rolling deployments.

Can I use gh-ost and pt-online-schema-change for zero-downtime MySQL migrations?

Yes, gh-ost and pt-online-schema-change are recommended tools for online schema changes in MySQL, providing safe cutover patterns and non-blocking DDL strategies during rolling or blue/green deployments.

What is the expand-contract pattern for online DDL and rolling deployments?

The expand-contract pattern for online DDL involves adding new schema elements, deploying application versions that write to both old and new structures, backfilling existing data, and finally removing the old elements across rolling deployments.

Does zero-downtime migration work with multi-tenant schemas and blue/green deployments?

Yes, zero-downtime migration is explicitly designed for multi-tenant schemas and blue/green deployments, providing safe deployment sequencing and canary rollout strategies to maintain high uptime requirements.

Why does adding a NOT VALID constraint prevent long table locks during migrations?

Adding a NOT VALID constraint prevents long table locks because PostgreSQL writes the constraint without scanning existing rows immediately, allowing validation to occur separately as a concurrent, non-blocking operation.