Database Migration

Write and integrate safe hand-written SQL migrations for GenesisPod databases.

2|3|Updated Nov 9, 2025
One-click install
npx skills add https://github.com/genesis-agents/GenesisPod --skill database-migration-genesis-agents
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Database Migration
Source: https://github.com/genesis-agents/GenesisPod/tree/main/.claude/skills/development/database-migration
Command: npx skills add https://github.com/genesis-agents/GenesisPod --skill database-migration-genesis-agents

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database migrations in GenesisPod rely on hand-written SQL and Prisma migrations, which can be error-prone and hard to coordinate; this skill codifies patterns and rules to ensure safe, repeatable upgrades and avoid common pitfalls.

Core Features & Use Cases

  • Hand-written SQL migrations and enum value additions
  • Safe migration practices avoiding subtransactions
  • Clear workflow from schema changes to deployment
  • Prisma integration and deployment guidance

Quick Start

Begin by updating the Prisma schema and then add a matching SQL migration file under backend/prisma/migrations with an idempotent change, followed by running Prisma generate and deploy.

Frequently Asked Questions about Database Migration

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

FAQPage Schema
How do I write safe hand-written SQL migrations for PostgreSQL?

Safe SQL migrations require using IF NOT EXISTS patterns and avoiding subtransaction issues to ensure repeatable database upgrades. This approach codifies those rules to prevent common errors when adding enums, tables, or indexes.

How do I add enum values safely during a database migration?

Adding enum values safely during a database migration involves using idempotent SQL patterns within your migration files to prevent conflicts. This skill automates the integration of these enum changes alongside Prisma schema updates.

What is the best way to integrate Prisma migrations with hand-written SQL?

The best way to integrate Prisma migrations with hand-written SQL is to update the Prisma schema first, then add a matching idempotent SQL migration file under your backend's prisma/migrations directory before deploying.

Why do my hand-written database migrations fail due to subtransaction issues?

Hand-written database migrations fail due to subtransaction issues when SQL statements trigger implicit transactions that conflict with migration execution rules. This skill enforces specific patterns to avoid these pitfalls during schema changes.

How do I deploy idempotent schema changes using Prisma?

To deploy idempotent schema changes using Prisma, update your schema, add a matching SQL migration file using IF NOT EXISTS patterns, then run Prisma generate and deploy to apply the changes safely to your database.