Database Migration

Use when planning or applying a raw-SQL database migration to a live PostgreSQL database — adding columns, renaming columns or tables, changing types, creating indexes, adding foreign keys, or running data backfills. Covers zero-downtime patterns (expand / contract, batched backfill, NOT VALID foreign keys, CONCURRENTLY indexes), the direct/unpooled connection requirement for migration tooling, branched-database workflows, and rollback strategy. Do NOT use for ORM-managed migrations driven by Prisma/Drizzle/TypeORM CLI scaffolding, for chasing a migration that has already failed in production (use debugging), for multi-release schema lifecycle planning outside one migration (use schema-evolution), or for designing the row-level-security model itself (use owasp-security). Do NOT use for design the row-level-security model for our new tenant table. Do NOT use for the migration crashed in production — find the root cause. Do NOT use for plan the full multi-release schema evolution for this domain.

jacob-balslev fa9ec4d 5 files · 58.2 KB Updated

File contents

jacob-balslev/skill-graph/tree/main/marketplace/skills/database-migration commit fa9ec4d720

Frequently asked questions

npx skillmds@latest add jacob-balslev/database-migration