database-migrations

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

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/hiroto0701/dotfiles --skill database-migrations-hiroto0701
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/hiroto0701/dotfiles/tree/main/private_dot_claude/skills/database-migrations
Command: npx skills add https://github.com/hiroto0701/dotfiles --skill database-migrations-hiroto0701

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

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

Core Features & Use Cases

  • Schema Evolution: Safely add, alter, or remove columns and indexes.
  • Data Migration: Handle complex data backfills and transformations.
  • Zero-Downtime: Implement strategies for deploying changes without interrupting service.
  • Rollback Planning: Ensure all changes can be safely reversed.
  • Tooling Support: Covers popular tools like Prisma, Drizzle, Django, and golang-migrate.
  • Use Case: You need to add a new is_active boolean column to your users table in PostgreSQL. This Skill will guide you through the safest way to do this, ensuring no table locks and providing a clear rollback path.

Quick Start

Use the database-migrations skill to learn how to safely add a new column to a PostgreSQL table.

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

Zero-downtime database migrations allow you to add columns without table locks by separating schema changes from application deployment. This involves adding nullable columns, backfilling data asynchronously, and ensuring your ORM like Prisma or Django handles the transition smoothly before enforcing constraints.

What is a zero-downtime database migration?

A zero-downtime database migration is a deployment strategy that evolves your database schema without interrupting service. It involves breaking large schema changes into smaller, backward-compatible steps that prevent table locks and data loss, ensuring continuous availability during production deployments across PostgreSQL and MySQL.

Does this database migration guidance work with Django and Prisma?

Yes, this guidance covers tooling support for popular ORMs and migration tools including Prisma, Drizzle, Django, and golang-migrate. It provides specific patterns, anti-patterns, and safety checklists for managing schema changes and rollbacks across these frameworks.

How do I safely rollback a data migration in production?

To safely rollback a data migration in production, ensure all changes can be safely reversed by planning a clear rollback path before deployment. This involves creating backward-compatible schema changes and writing specific down-migrations that restore previous states without data loss.

What are common anti-patterns when changing a database schema?

Common anti-patterns when changing a database schema include adding columns with default values that lock large tables, running data backfills synchronously during deployment, and making non-backward-compatible changes that prevent safe rollbacks in production environments.