rrezartprebreza/spring-boot-skills/flyway-migrations
Claude Code and agent skill by rrezartprebreza/spring-boot-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Use when creating database migrations, schema changes, seed data, or any SQL that modifies database structure. Covers Flyway naming conventions, versioning, and safe migration patterns.
Install
npx vskill@latest install rrezartprebreza/spring-boot-skills/flyway-migrationsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as rrezartprebreza/spring-boot-skills/flyway-migrations.
Flyway Migrations
Dependencies
Boot's modular starters do NOT pull Flyway in transitively — spring-boot-starter-data-jpa alone means migrations silently never run. Add the Flyway starter plus your database's module:
File Naming Convention
Rules:
- Double underscore
__between version and description - Underscore
_for spaces in description - Sequential versions — never go back and fill gaps
- Never modify a migration that has already run in any environment
Example Migrations
Safe Migration Patterns
application.yml
Onboarding an existing database
Keep automatic baselining disabled in normal application configuration. For a database that already has tables but no Flyway history:
- Back up the database and verify the target URL, database, schema and credentials.
- Compare its schema with the migrations and explicitly select the version already present.
- Run a one-time
flyway baseline -baselineVersion=<verified-version>using that target. - Inspect
flyway info, then migrate only the later versions. Never baseline an unknown
or partially migrated schema just to silence a startup error.
This is different from a baseline migration script for new environments. Automatic baselining removes Flyway's wrong-database safety check: official baseline-on-migrate documentation.
Seed Data (test/dev only)
Team Workflow: Concurrent Migrations
- Multiple developers creating migrations simultaneously will cause version conflicts
- Solution: use a shared tracker (Slack channel, wiki page) or timestamp-based versions (
V20260414_1__) - If two migrations target the same version, one developer must bump theirs
- Run
flyway infobefore committing to check for version gaps or duplicates - In CI/CD: run
flyway validateas a pre-deploy step to catch conflicts early - Never set
out-of-order: truein production — it masks migration ordering bugs
Gotchas
- Agent names files
V1_create_users.sql(single underscore) — must be double__ - Agent modifies existing migration files — never edit a migration that has run
- Agent adds
NOT NULLcolumn without default — use nullable or provide default - Agent renames columns directly — use multi-step add/backfill/drop across deploys
- Agent seeds data in Flyway migrations — use
@Profile("dev")seeders instead - Agent mixes
CREATE INDEX CONCURRENTLYwith other statements in one migration — Flyway rejects it ("both transactional and non-transactional statements"); give it its own file - Agent ships a
CONCURRENTLYmigration withoutspring.flyway.postgresql.transactional-lock=false— the index build waits on Flyway's own advisory-lock transaction and deploys hang - Agent skips indexes — always index foreign keys and columns used in WHERE/ORDER BY
- Agent creates migration with
DROP TABLEorDROP COLUMNas first step — always add new column, deploy code, then drop old in a later migration - Agent adds only
flyway-core— database support lives inflyway-database-<db>modules; without it startup fails with "Unsupported Database" - Migrating from Boot 3:
flyway-corealone used to activate migrations because the auto-configuration lived inspring-boot-autoconfigure; Boot 4 moved it tospring-boot-flyway, so withoutspring-boot-starter-flywaymigrations silently never run
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/spring-boot-4/flyway-migrations/SKILL.md
Popularity
- Repository stars
- 273
- Repository forks
- 42
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rrezartprebreza/spring-boot-skills/flyway-migrations)