void-drizzle-migration-safe

Writes zero-downtime Drizzle migrations for Postgres databases under concurrent production traffic.

Updated May 29, 2026
One-click install
npx skills add https://github.com/voidcorp-core/void-harness --skill void-drizzle-migration-safe-voidcorp-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: void-drizzle-migration-safe
Source: https://github.com/voidcorp-core/void-harness/tree/main/packages/cli/core-assets/packs/pack-server/skills/void-drizzle-migration-safe
Command: npx skills add https://github.com/voidcorp-core/void-harness --skill void-drizzle-migration-safe-voidcorp-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Schema changes on a live Postgres database can lock tables, break running application pods, or corrupt data when done naively. This Skill enforces safe multi-deploy migration patterns for Drizzle ORM so columns, indexes, foreign keys, and enums change without downtime. ## Core Features & Use Cases - Safe column lifecycle patterns: Add NOT NULL columns, rename columns, and drop columns across multiple deploys with backfill steps instead of single locking statements. - Lock-free index and constraint creation: Edits drizzle-kit generated SQL to use CREATE INDEX CONCURRENTLY and NOT VALID foreign keys, with validation queries for invalid indexes. - Enum change checklists: Covers adding, renaming, and the multi-migration reality of removing Postgres enum values. - Use Case: When asked to add a NOT NULL locale column to a production users table, the Skill produces three separate migrations (nullable add, backfill, SET NOT NULL) spread across two deploys, plus the hand-edited SQL drizzle-kit will not generate on its own. ## Quick Start Ask the agent to add a NOT NULL column to a production Drizzle table and it will plan the multi-deploy migration sequence with edited SQL.

Frequently Asked Questions about void-drizzle-migration-safe

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

FAQPage Schema
How do I add a NOT NULL column in Drizzle without downtime?

Add the column as nullable in one migration, run a backfill UPDATE in a second step, then apply ALTER COLUMN SET NOT NULL in a third migration. This spans at least two deploys so running pods never encounter a constraint violation.

How to create an index on a large Postgres table with Drizzle?

Generate the migration with drizzle-kit, then hand-edit the SQL to use CREATE INDEX CONCURRENTLY, which avoids locking writes. Afterwards verify indisvalid in pg_index, since concurrent builds can fail and leave an invalid index.

Does drizzle-kit generate production-safe migration SQL automatically?

No. drizzle-kit does not add CONCURRENTLY to index creation or NOT VALID to foreign keys, and enum changes can produce broken SQL. Always inspect and edit the generated migration files before deploying to production.

How do I rename a Postgres column without breaking running app pods?

Treat the rename as a delete plus add: ship the new column, dual-write both columns for one deploy cycle, backfill, switch reads to the new column, then drop the old one in a later deploy. A direct RENAME takes an exclusive lock and breaks pods still reading the old name.

When should this zero-downtime migration discipline not be used?

Skip it for fresh schemas before any production deployment, where raw drizzle-kit generate and push are sufficient. The multi-deploy discipline only starts once the database serves real production traffic.