database-migration-safety

Plan and review production database schema migrations with expand-contract phases.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ohsonerdy/openclaw-frontier-stack --skill database-migration-safety
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration-safety
Source: https://github.com/ohsonerdy/openclaw-frontier-stack/tree/main/skills/database-migration-safety
Command: npx skills add https://github.com/ohsonerdy/openclaw-frontier-stack --skill database-migration-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents production incidents caused by unsafe database schema migrations by ensuring changes are planned and executed with clear lock-safety, rollback/one-way discipline, and the expand-contract approach.

Core Features & Use Cases

  • Expand-contract migration planning: Breaks risky schema+code changes into independent phases (expand, migrate, switch, contract) so the system never lands in a broken transitional state.
  • Online safety filtering by operation type: Evaluates common operations (NOT NULL, type changes, constraints, unique indexes, FK validation, drops/renames) and flags when they require expand-contract or online schema change tooling.
  • Operationally safe backfill and rollback strategy: Designs throttled, resumable, idempotent backfills and enforces reversible vs explicitly one-way decisions with backup-verified rollback paths.

Quick Start

Use database-migration-safety when you are planning a production migration to get an expand-contract phase plan, a lock/online-safety verdict, and a rollback or explicitly one-way justification.

Frequently Asked Questions about database-migration-safety

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

FAQPage Schema
How do I prevent database downtime during production schema migrations?

You prevent database downtime during production schema migrations by using an expand-contract plan that breaks changes into independent phases, ensuring the system never lands in a broken transitional state while minimizing locking risk.

What is the expand-contract pattern for online schema changes?

The expand-contract pattern for online schema changes separates risky migrations into expand, migrate, switch, and contract phases, allowing you to add columns and backfill data before switching application traffic and dropping old schema.

How do I safely backfill large production database tables?

To safely backfill large production database tables, execute batched, throttled, and resumable backfills that are idempotent, ensuring the operation can pause under load and resume without data corruption or locking issues.

When do database migrations require online schema change tooling?

Database migrations require online schema change tooling when operations involve adding NOT NULL constraints, type changes, unique indexes, or FK validations that risk locking tables or causing outages during production traffic.

How do I plan rollback criteria for one-way database migrations?

Plan rollback criteria for one-way database migrations by enforcing reversible versus explicitly one-way decisions with backup-verified rollback paths, ensuring you have verified data backups before executing irreversible schema changes.

What are the limitations of using expand-contract migrations for dropping columns?

A limitation of using expand-contract migrations for dropping columns is that the contract phase becomes a one-way operation, requiring explicit justification and backup verification because the dropped data cannot be restored without point-in-time recovery.