database-patterns

Standardize PostgreSQL raw SQL migrations with naming and template conventions.

3|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/gulati8/justice-league-factory --skill database-patterns-gulati8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-patterns
Source: https://github.com/gulati8/justice-league-factory/tree/main/.claude/skills/database-patterns
Command: npx skills add https://github.com/gulati8/justice-league-factory --skill database-patterns-gulati8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostgreSQL migrations using raw SQL are error-prone without shared patterns; this skill provides a standardized, repeatable approach to managing schema changes, ensuring consistency and safety across projects.

Core Features & Use Cases

  • Migration File Conventions: clear naming, structure, and templates to enforce repeatable, auditable migrations.
  • Schema Change Type Catalog: guidance on adds, renames, backfills, soft deletes, and transforms with safety checks.
  • Full-Stack Checklist for Schema Changes: a comprehensive guide that covers backend migrations, models, APIs, tests, and frontend types to keep the stack aligned.

Quick Start

Set up and apply the migration standards in your project by following the conventions and consulting the migration examples.

Frequently Asked Questions about database-patterns

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

FAQPage Schema
What are the best practices for safe PostgreSQL schema changes using raw SQL?

Safe PostgreSQL schema changes require standardized file naming, template migrations, and idempotent operations to ensure repeatable, auditable database migrations across projects.

How do I manage database migrations for backfills and soft deletes in PostgreSQL?

Manage database migrations by applying a schema change type catalog that provides specific guidance and safety checks for operations like backfills, soft deletes, renames, and transforms.

How do I keep frontend types and backend models aligned after a SQL migration?

Keep your stack aligned after a SQL migration by applying a full-stack consistency checklist that covers backend models, APIs, tests, and frontend types.

Can I use these migration patterns with an ORM or only for raw SQL?

These migration patterns apply specifically to PostgreSQL backends using raw SQL migrations, rather than ORM-based schema management, to enforce direct SQL consistency.

Why do my PostgreSQL schema changes fail during production deployments?

Schema changes often fail due to non-idempotent operations and poor file conventions; standardizing migration templates and enforcing safety checks prevents these deployment errors.