database-migrations

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

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/thanhquan3010/hospital-service-management-system --skill database-migrations-thanhquan3010
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/thanhquan3010/hospital-service-management-system/tree/main/.agent/skills/database-migrations
Command: npx skills add https://github.com/thanhquan3010/hospital-service-management-system --skill database-migrations-thanhquan3010

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

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

Core Features & Use Cases

  • Schema Evolution: Safely alter database tables, add/remove columns, and manage indexes across different database systems (PostgreSQL, MySQL) and ORMs (Prisma, Drizzle, Django, TypeORM, golang-migrate).
  • Data Migrations: Execute complex data backfills and transformations.
  • Zero-Downtime Deployments: Implement strategies for applying changes without interrupting service.
  • Rollback Planning: Ensure migrations can be safely reversed.
  • Use Case: You need to add a new, non-nullable column to a large users table in production without locking the table or causing downtime. This skill guides you through the expand-contract pattern and safe column addition techniques.

Quick Start

Use the database-migrations skill to apply pending migrations to the production PostgreSQL database.

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 non-nullable column to a large PostgreSQL table without locking it?

To add a non-nullable column safely, use the expand-contract pattern for zero-downtime deployments. This database migration technique separates schema changes into multiple reversible steps, preventing table locks and service interruptions on large production tables.

What is the best way to handle data backfills during a zero-downtime schema migration?

The best way to handle data backfills is separating data migrations from schema changes. This approach executes complex data transformations independently, ensuring immutability and safe rollback planning without interrupting service during production deployments.

Does this database migration approach work with Prisma and TypeORM?

Yes, this approach works with Prisma, TypeORM, Drizzle, Django, and golang-migrate. It manages schema changes and data migrations across multiple ORMs and database systems like PostgreSQL, ensuring reversible schema evolution and safe production deployments.

How do I ensure my database schema changes are reversible?

Ensure database schema changes are reversible by enforcing immutability, separation of concerns, and thorough testing for all migration operations. This methodology guarantees that migrations can be safely reversed without data loss during production rollbacks.

When do I need to use the expand-contract pattern for database migrations?

You need the expand-contract pattern when applying zero-downtime schema changes to large production tables. This methodology prevents data loss and minimizes downtime by breaking schema evolution into safe, reversible deployment phases across database systems.