postgres-migrations

Generate PostgreSQL migration scripts that avoid blocking reads and writes.

3|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/frizzle-chan/mudd --skill postgres-migrations-frizzle-chan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-migrations
Source: https://github.com/frizzle-chan/mudd/tree/main/.claude/skills/postgres-migrations
Command: npx skills add https://github.com/frizzle-chan/mudd --skill postgres-migrations-frizzle-chan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write PostgreSQL migrations that avoid blocking critical read and write operations in production environments, ensuring application availability during database changes.

Core Features & Use Cases

  • Safe Schema Changes: Provides patterns and guidance for adding columns, indexes, and constraints without downtime.
  • Downtime Avoidance: Details strategies for operations like ALTER TABLE and CREATE INDEX that minimize locking.
  • Use Case: When adding a new NOT NULL column to a large users table, use this Skill to follow the multi-step process of adding it as nullable, backfilling data, and then applying the NOT NULL constraint safely.

Quick Start

Use the postgres-migrations skill to add a unique index concurrently to the email column on the users table.

Frequently Asked Questions about postgres-migrations

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

FAQPage Schema
How do I add a NOT NULL column to a large PostgreSQL table without downtime?

To add a PostgreSQL NOT NULL column without downtime, apply a multi-step process: add the column as nullable, backfill the existing data, and then safely apply the NOT NULL constraint. This prevents blocking writes during schema modifications.

How do I create an index in PostgreSQL without locking the table for writes?

To create a PostgreSQL index without locking writes, use the CREATE INDEX CONCURRENTLY command. This allows the index build to occur without blocking critical read and write operations on the table during the migration.

What causes an ALTER TABLE command to block read and write operations in PostgreSQL?

PostgreSQL ALTER TABLE commands block operations when they acquire exclusive locks that conflict with concurrent read and write transactions. Understanding PostgreSQL lock types and concurrent operations is required to prevent these blocking issues.

How do I ensure my SQL migrations follow safe PostgreSQL best practices?

To ensure safe PostgreSQL migrations, generate scripts that adhere to Squawk linter rules. This approach validates your schema changes against established best practices for adding columns, indexes, and constraints without causing downtime.

What is the best way to apply database constraints without affecting application availability?

The best way to apply PostgreSQL constraints without downtime is using strategies that minimize locking, such as adding constraints after backfilling data. This ensures application availability during critical database schema modifications.