Database Migration

Guides Flyway database migrations with naming conventions, safe patterns, and rollback strategies.

Updated May 12, 2026
One-click install
npx skills add https://github.com/ZzZueszZ/claude-kit --skill database-migration-zzzueszz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Database Migration
Source: https://github.com/ZzZueszZ/claude-kit/tree/main/.claude/skills/database-migration
Command: npx skills add https://github.com/ZzZueszZ/claude-kit --skill database-migration-zzzueszz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Database schema changes in production are risky: a poorly planned migration can break running code, lock large tables, or leave no way to recover. This Skill provides conventions and patterns for writing safe, backwards-compatible migrations with Flyway, especially for Spring Boot and Oracle environments. ## Core Features & Use Cases - Flyway Conventions: Enforces versioned (V), repeatable (R), and undo (U) file naming, semantic version numbering, and one-logical-change-per-file rules. - Safe Migration Patterns: Provides multi-step approaches for dangerous operations like renaming columns, changing column types, and dropping columns or tables without breaking deployed code. - Rollback Strategies: Covers forward-fix, manual rollback scripts, and backup-table approaches with clear rules for production safety. - Use Case: When adding a status column to a large Oracle orders table in a Spring Boot app, use this Skill to write a metadata-only ALTER TABLE migration with a proper header, index, constraints, and a documented rollback plan. ## Quick Start Ask the assistant to write a Flyway migration that adds a new column to an existing table following safe backwards-compatible patterns with a rollback plan.

Frequently Asked Questions about Database Migration

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

FAQPage Schema
How do I write a Flyway migration file with correct naming?▼

Name versioned migrations as V{major}.{minor}.{patch}__{description}.sql, for example V1.2.0__create_orders_table.sql. Use R__ prefix for repeatable migrations and U__ for undo migrations. Each file should perform exactly one logical change and include a header comment with description, author, date, and rollback steps.

How to rename a database column without breaking production code?▼

Use a two-migration approach: first add the new column and copy data from the old one, then deploy code supporting both columns. In a later migration, drop the old column once no code references it. Never rename directly in a single migration while old code is running.

Can I modify a Flyway migration after it has been applied?▼

No, editing an applied migration causes a checksum mismatch and Flyway validation failures. Always create a new migration to fix or extend previous changes, following the forward-fix strategy rather than modifying history.

Does Flyway support rollback for failed migrations?▼

Flyway Community does not auto-rollback versioned migrations, so the recommended approach is forward-fix with a new corrective migration. Alternatively, document manual rollback scripts in each migration header or create backup tables before destructive changes.

How do I add a column to a large Oracle table without downtime?▼

In Oracle 12c and later, adding a column with a DEFAULT value is a metadata-only operation that completes instantly. Create indexes with the ONLINE keyword and add constraints with NOVALIDATE, validating them later to avoid locking the table.

Why should spring.flyway.clean-disabled be true in production?▼

The flyway clean command drops all objects in the configured schema, which would destroy production data. Setting clean-disabled to true in production profiles prevents accidental execution, while development profiles can keep it enabled for resetting test databases.