Provide deterministic database schema evolution with Flyway migrations.
When to Use
Use when schema changes must be versioned, reviewable, and reproducible across environments.
Rules
Store migrations under src/main/resources/db/migration.
Use versioned migration naming V<version>__<description>.sql.
Use repeatable migrations R__<description>.sql only for objects intended to be re-applied on checksum change (for example views).
Use flyway validate in CI or pre-release checks.
Baseline existing databases explicitly before first managed migration.
Use repair only to recover schema history consistency after confirmed operator review.
Defaults
Version numbers are monotonically increasing.
Keep each migration focused on one logical schema change.
Migration files are immutable after release; fix forward with new migrations.
Production-like environments run with validation enabled.
Validation Checklist
Before finishing:
New schema changes include migration files.
Migration naming follows Flyway conventions.
Local and CI runs pass validate.
Baseline strategy is documented when integrating legacy schemas.
Anti-Patterns
Do NOT edit previously applied versioned migrations.
Do NOT depend on runtime auto-DDL instead of migrations in non-test profiles.
Do NOT run destructive commands like clean in shared environments.
Do NOT hide migration order or ownership in ad-hoc SQL scripts.
1---2name: flyway-migrations3description: Skill: flyway-migrations4---5# Skill: flyway-migrations67## Type8core910## Requirements1112- spring-data-jpa1314---1516## Purpose1718Provide deterministic database schema evolution with Flyway migrations.1920---2122## When to Use2324Use when schema changes must be versioned, reviewable, and reproducible across environments.2526---2728## Rules2930- Store migrations under `src/main/resources/db/migration`.31- Use versioned migration naming `V<version>__<description>.sql`.32- Use repeatable migrations `R__<description>.sql` only for objects intended to be re-applied on checksum change (for example views).33- Use `flyway validate` in CI or pre-release checks.34- Baseline existing databases explicitly before first managed migration.35- Use `repair` only to recover schema history consistency after confirmed operator review.3637---3839## Defaults4041- Version numbers are monotonically increasing.42- Keep each migration focused on one logical schema change.43- Migration files are immutable after release; fix forward with new migrations.44- Production-like environments run with validation enabled.4546---4748## Validation Checklist4950Before finishing:5152- New schema changes include migration files.53- Migration naming follows Flyway conventions.54- Local and CI runs pass `validate`.55- Baseline strategy is documented when integrating legacy schemas.5657---5859## Anti-Patterns6061- Do NOT edit previously applied versioned migrations.62- Do NOT depend on runtime auto-DDL instead of migrations in non-test profiles.63- Do NOT run destructive commands like `clean` in shared environments.64- Do NOT hide migration order or ownership in ad-hoc SQL scripts.
Run npx skillmds@latest add carlnaddy/flyway-migrations in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Skill: flyway-migrations It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
CarlNaddy (@carlnaddy) published this skill. Their other Agent Skills are listed on their SkillMD profile.