Skip to content

Handle null version for Flyway repeatable migrations - #209

Open
sksamuel wants to merge 1 commit into
mainfrom
fix/flyway-null-version-repeatable
Open

Handle null version for Flyway repeatable migrations#209
sksamuel wants to merge 1 commit into
mainfrom
fix/flyway-null-version-repeatable

Conversation

@sksamuel

Copy link
Copy Markdown
Owner

Summary

Flyway's `MigrationInfo.getVersion()` returns null for repeatable migrations. The previous `it.version.toString()` either NPE'd (platform type inferred non-null) or recorded the literal string `"null"`. Use a safe call with empty fallback — same fix shape as the pending-migration NPE in 5ea010d.

Test plan

  • Existing tests pass
  • Migration list with a repeatable migration no longer throws and shows an empty version

🤖 Generated with Claude Code

Flyway's `MigrationInfo.getVersion()` returns null for repeatable
migrations. The previous unsafe `.toString()` either threw NPE (if the
platform type was inferred non-null) or recorded the literal string
`"null"` in the `Migration.version` field. Use a safe call with empty
fallback, matching the pattern used for `installedBy` and `installedOn`
just above (and following the same class of fix as commit 5ea010d for
pending migrations).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant