dora-migration-safety

Generate and validate database migration SQL with safety categories.

14|1|Updated May 11, 2025
One-click install
npx skills add https://github.com/remcostoeten/dora --skill dora-migration-safety
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dora-migration-safety
Source: https://github.com/remcostoeten/dora/tree/main/.claude/skills/dora-migration-safety
Command: npx skills add https://github.com/remcostoeten/dora --skill dora-migration-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill manages the complex lifecycle of database schema migrations, ensuring that destructive or risky operations are identified, gated, and handled with appropriate safety warnings before execution.

Core Features & Use Cases

  • Migration Safety Gates: Automatically classifies schema changes as safe, review-required, or destructive, preventing accidental data loss.
  • SQL Emission & Sectioning: Generates structured migration SQL with clear banners for destructive operations and commented-out sections for manual review.
  • Use Case: When refactoring a production database schema, use this Skill to generate a migration script that separates safe additive changes from destructive drops, ensuring you can review and opt-in to risky operations before they reach the console.

Quick Start

Use the dora-migration-safety skill to analyze the current schema diff and generate a safe, sectioned migration script for the active database connection.

Frequently Asked Questions about dora-migration-safety

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

FAQPage Schema
How do I prevent data loss when generating database migration scripts?

To prevent data loss during database migration, schema changes are classified into safe, review-required, and destructive categories. Destructive operations are explicitly flagged and gated against accidental execution before the executable SQL text is generated.

How do I generate a safe migration script from a schema diff?

Generating a safe migration script from a schema diff involves classifying changes and assembling structured SQL sections. The process outputs executable SQL text with clear banners for destructive operations and commented-out sections requiring manual review.

Does this migration safety approach work with both Prisma and Drizzle schemas?

Yes, this migration safety approach supports both Prisma and Drizzle schemas. It operates directly on the schema diff to classify changes and manage down-script generation regardless of the specific ORM framework used.

What is the best way to separate safe additive changes from destructive drops in SQL migrations?

The best way to separate safe additive changes from destructive drops is through SQL emission and sectioning. This approach generates structured migration SQL with clear banners for destructive operations, allowing you to review and opt-in to risky changes.

How are destructive database schema changes gated for manual review?

Destructive database schema changes are gated for manual review using preview gating mechanisms. The generated SQL places these operations in commented-out sections with clear banners, ensuring risky drops require explicit opt-in before reaching the console.

When should I not use automated SQL emission for database schema migrations?

You should not rely solely on automated SQL emission when a schema diff contains ambiguous lossy operations requiring manual intervention. In these cases, the generated down-script and destructive sections need human review before any execution proceeds.