database-migrations

Plan and rollback zero-downtime schema and data migrations across PostgreSQL, MySQL, and ORMs.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/officechbusinessservices-creator/CompliCore --skill database-migrations-officechbusinessservices-creator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/officechbusinessservices-creator/CompliCore/tree/main/.claude/skills/database-migrations
Command: npx skills add https://github.com/officechbusinessservices-creator/CompliCore --skill database-migrations-officechbusinessservices-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database migrations are error-prone and risky in production environments, often causing downtime or data inconsistency across engines and ORMs. This skill provides best practices and reusable patterns to safely plan, implement, and rollback schema and data migrations across PostgreSQL, MySQL, Prisma, Drizzle, Kysely, Django, TypeORM, and golang-migrate, reducing risk and improving deployment velocity.

Core Features & Use Cases

  • Migration Safety Checklist: ensures UP/DOWN, default values, concurrent indexes, and separate data/schema migrations.
  • Zero-Downtime Patterns: adopt expand-contract approach, add-new-column safely, and perform controlled backfills.
  • ORM/Tooling Guidance: covers Prisma, Drizzle, Kysely, Django, TypeORM, and golang-migrate workflows with concrete examples.
  • Anti-Patterns & Validation: warns against manual SQL in production, dropping columns prematurely, and untracked migrations.
  • Operational Readiness: provides guidance for testing in staging and validating data integrity post-migration.

Quick Start

Review the migration safety checklist and draft your first zero-downtime plan using the expand-contract pattern in your project.

Frequently Asked Questions about database-migrations

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

FAQPage Schema
How do I perform zero-downtime database migrations in PostgreSQL or MySQL?

Zero-downtime database migrations use the expand-contract pattern to separate schema changes from data backfills. This approach safely adds new columns, performs controlled updates, and contracts old schema across PostgreSQL and MySQL without locking tables.

What are the most common database migration anti-patterns to avoid in production?

Common database migration anti-patterns include executing manual SQL in production, dropping columns prematurely before application updates, and leaving migrations untracked. These practices cause data inconsistency and unexpected downtime during schema deployments.

Does this migration guidance work with ORMs like Prisma, Drizzle, and TypeORM?

Yes, this database migration guidance covers tool-specific workflows for Prisma, Drizzle, Kysely, Django, TypeORM, and golang-migrate. It provides concrete examples for planning and implementing safe schema changes within these ORM environments.

How do I rollback a schema change safely using forward-only migrations?

Forward-only migrations handle rollbacks by applying a new compensating migration rather than reverting the database state. This ensures data integrity by moving the schema forward while safely undoing the effects of the previous deployment.

When should I separate schema changes from data migrations?

You should separate schema changes from data migrations to maintain zero-downtime during deployment. This separation allows the database to accept new structures first, followed by controlled data backfills without locking tables or blocking application traffic.

What is the best way to validate data integrity after a database migration in staging?

Validating data integrity after a database migration involves testing the deployment in staging and running post-migration checks. This operational readiness step verifies that UP and DOWN migrations, default values, and concurrent indexes function correctly before production release.