ecc-database-migrations

Implements safe, reversible database schema migrations across PostgreSQL and common ORMs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Changing production database schemas without breaking running applications is risky: naive migrations lock tables, rewrite millions of rows, or leave environments out of sync. This Skill provides proven patterns for schema changes, data backfills, and zero-downtime deployments. ## Core Features & Use Cases - Safe PostgreSQL Patterns: Add columns and indexes without table locks using nullable columns, defaults, and CREATE INDEX CONCURRENTLY. - Multi-ORM Workflows: Covers Prisma, Drizzle, Kysely, Django, and golang-migrate with concrete commands and migration file examples. - Zero-Downtime Strategy: Guides the expand-contract pattern for renaming or removing columns across multiple deploys. - Use Case: You need to rename a heavily used column on a 10M-row users table. Follow the expand-contract steps: add the new column, backfill in batches, switch application reads, then drop the old column in a later migration. ## Quick Start Ask the assistant to plan a zero-downtime migration that adds a non-null column with an index to a large PostgreSQL table using your ORM.

Frequently Asked Questions about ecc-database-migrations

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

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

Add the column as nullable or with a default value, which PostgreSQL 11+ applies instantly without rewriting the table. Never add a NOT NULL column without a default on an existing table, since that forces a full table rewrite and lock.

How to rename a database column in production safely?

Use the expand-contract pattern instead of a direct rename. Add the new column, backfill existing rows, deploy code that writes to both columns, switch reads to the new column, then drop the old column in a later migration.

Why does CREATE INDEX lock my PostgreSQL table?

A plain CREATE INDEX blocks writes while the index builds on large tables. Use CREATE INDEX CONCURRENTLY instead, which allows concurrent writes, though it cannot run inside a transaction block and may need special handling in migration tools.

Can Prisma generate concurrent indexes for PostgreSQL?

Prisma cannot generate CREATE INDEX CONCURRENTLY automatically. Create an empty migration with prisma migrate dev --create-only, then write the concurrent index SQL manually in the generated migration file.

Should schema changes and data backfills be in one migration?

No, schema and data migrations should be separate. Mixing DDL and DML in one migration creates long transactions that are hard to roll back. Apply the schema change first, then run a batched backfill as its own migration.

When should I not edit an existing migration file?

Never edit a migration that has already run in production, because it causes schema drift between environments. Migrations are immutable once deployed; create a new forward migration to correct or extend the change instead.