Schema Migration

Generate SQL schema migrations with rollback procedures and multi-phase execution.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/cdalsoniii/brightpath-coder --skill schema-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Schema Migration
Source: https://github.com/cdalsoniii/brightpath-coder/tree/main/.cursor/skills/schema-migration
Command: npx skills add https://github.com/cdalsoniii/brightpath-coder --skill schema-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of safe, zero-downtime database schema migrations, including rollback procedures, to prevent data loss and minimize application downtime.

Core Features & Use Cases

  • Zero-Downtime Migrations: Generates SQL for safe schema changes that avoid locking critical tables for extended periods.
  • Rollback Procedures: Automatically creates corresponding DOWN migrations for easy reversion if issues arise.
  • Backward-Compatibility: Assesses and ensures compatibility with older application versions using patterns like expand-and-contract.
  • Use Case: When adding a new column to a high-traffic users table, this Skill will generate a multi-phase migration to add the column as nullable, backfill data, and then make it non-nullable, all while minimizing user impact.

Quick Start

Use the schema migration skill to create a migration for adding a new email_verified boolean column to the users table.

Frequently Asked Questions about Schema Migration

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

FAQPage Schema
How do I perform zero-downtime database schema migrations on high-traffic tables?

Zero-downtime schema migrations use multi-phase execution patterns like expand-and-contract to ensure backward compatibility. This approach prevents locking critical tables by adding nullable columns, backfilling data, and applying constraints incrementally.

What is the best way to generate rollback procedures for SQL schema changes?

Generating rollback procedures for SQL schema changes involves automatically creating corresponding DOWN migrations alongside UP migrations. This ensures easy reversion to previous database states if application issues arise post-deployment.

How does the expand-and-contract pattern work for backward-compatible database migrations?

The expand-and-contract pattern for backward-compatible database migrations works by expanding the schema first, migrating application logic, and then contracting old structures. This multi-phase method minimizes downtime and ensures older application versions remain functional.

Can I add a non-nullable column to a database table without causing application downtime?

Adding a non-nullable column without application downtime requires a multi-phase SQL migration. You first add the column as nullable, backfill existing rows with default data, and finally enforce the non-nullable constraint in a separate phase.

What information do I need to analyze before planning a database schema migration?

Planning a database schema migration requires analyzing the current and desired schema states, data volume, and downtime tolerance. This analysis determines the necessary multi-phase execution patterns to prevent data loss and minimize locking.

When should I avoid single-phase SQL migrations for schema evolution?

You should avoid single-phase SQL migrations when changing high-traffic tables with low downtime tolerance. Single-phase changes risk extended table locking and data loss, whereas multi-phase migrations ensure safe, backward-compatible database evolution.