database-migrations

Generate safe migration plans for PostgreSQL schema changes.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/ThejanaJayalath/Niolla-PM-system --skill database-migrations-thejanajayalath
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/ThejanaJayalath/Niolla-PM-system/tree/main/.cursor/skills/database-migrations
Command: npx skills add https://github.com/ThejanaJayalath/Niolla-PM-system --skill database-migrations-thejanajayalath

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the high-risk challenge of modifying production database schemas without causing downtime, data loss, or performance degradation.

Core Features & Use Cases

  • Zero-Downtime Patterns: Implements expand-contract strategies for renaming columns and dropping fields safely.
  • Tooling Support: Provides standardized workflows for Prisma, Drizzle, Kysely, Django, and golang-migrate.
  • Use Case: When you need to rename a column in a table with millions of rows, this skill guides you through the multi-step process of adding a new column, backfilling data, and safely removing the old column without locking the database.

Quick Start

Use the database-migrations skill to generate a safe migration plan for adding a non-nullable column to the users table in a 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 rename a column in PostgreSQL without locking the table?

To rename a column without table locks, use an expand-contract strategy: add a new column, backfill data, update application reads, and safely drop the old column. This multi-step migration pattern prevents downtime on large tables.

What is the best way to add a non-nullable column to a large database table?

The best way to add a non-nullable column is a multi-step migration plan. Add the column as nullable, backfill existing rows with data, enforce constraints, and separate DDL execution from DML to prevent database locks.

Does this database migration approach work with Prisma and Django?

Yes, this database migration approach works with Prisma, Django, Drizzle, Kysely, and golang-migrate. It provides standardized workflows for diverse ORM environments to ensure production-grade deployment stability.

Why do database migrations cause downtime and how can I prevent it?

Database migrations cause downtime by acquiring exclusive table locks during schema changes. Prevent it by enforcing strict migration principles like concurrent index creation and separate DDL/DML execution for non-blocking SQL patterns.

When do I need to use an expand-contract database migration pattern?

You need the expand-contract migration pattern when modifying production database schemas to avoid downtime, data loss, or performance degradation. It is essential for safely renaming columns and dropping fields in large tables.