database-migrations

Guide database schema changes and data migrations across PostgreSQL, MySQL, and ORMs.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/unju-ai/ecc --skill database-migrations-unju-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/unju-ai/ecc/tree/main/skills/database-migrations
Command: npx skills add https://github.com/unju-ai/ecc --skill database-migrations-unju-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides best practices and tooling guidance for managing database schema changes and data migrations safely and efficiently, minimizing downtime and preventing data loss.

Core Features & Use Cases

  • Schema Evolution: Guides on adding, altering, or removing tables and columns across various databases (PostgreSQL, MySQL) and ORMs (Prisma, Drizzle, Django, TypeORM, golang-migrate).
  • Data Migration: Strategies for safely backfilling or transforming data as part of schema changes.
  • Zero-Downtime Deployments: Detailed patterns for making critical schema changes without interrupting service.
  • Use Case: You need to add a new is_active boolean column to your users table in PostgreSQL. This Skill will guide you through the safest way to do this using ALTER TABLE ... ADD COLUMN ... DEFAULT true to avoid table rewrites and downtime.

Quick Start

Use the database-migrations skill to learn how to safely add a new column to a PostgreSQL table.

Frequently Asked Questions about database-migrations

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

FAQPage Schema
How do I add a column to a PostgreSQL table without downtime?

To add a column without downtime in PostgreSQL, use `ALTER TABLE ... ADD COLUMN ... DEFAULT true` to avoid expensive table rewrites. This database migration pattern ensures zero-downtime schema changes by preventing the database from locking and rewriting the entire table.

What is the best way to handle database schema changes with an ORM?

The best way to handle database schema changes with an ORM is following safe migration patterns like expand-and-contract. This Skill provides specific guidance for ORMs like Prisma, Drizzle, Django, TypeORM, and golang-migrate to ensure safe schema evolution.

Does this database migration guidance work with MySQL and PostgreSQL?

Yes, this database migration guidance works with both MySQL and PostgreSQL. It covers specific patterns for safely evolving schemas, backfilling data, and executing rollbacks across these relational database systems to prevent data loss.

How do you backfill data during a zero-downtime migration?

Backfilling data during a zero-downtime migration requires separating schema changes from data transformations. This Skill details strategies for safely backfilling or transforming data in batches to avoid locking tables and interrupting service availability.

What are common anti-patterns to avoid during SQL schema migrations?

Common SQL schema migration anti-patterns include applying breaking schema changes in a single step and lacking rollback strategies. This Skill outlines specific anti-patterns to avoid, ensuring your database migrations do not cause data loss or unexpected downtime.