chore(database): add option to enable out of order flyway migrations (#5281)#6316
Conversation
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
There was a problem hiding this comment.
⚠️ Not ready to approve
There are blocking correctness/release issues (non-existent Maven goal configured, snapshot version pinning, and out-of-order defaulting to false vs stated requirements) that should be fixed before merge.
Pull request overview
This PR introduces a Flyway configuration toggle for out-of-order migrations and adds a new openaev-maven-plugin module intended to generate timestamped Java-based migration templates, reducing migration version conflicts during parallel development.
Changes:
- Add
spring.flyway.out-of-orderconfiguration (currently defaulting to disabled via env var). - Add a new Maven plugin module to generate a templated Flyway migration Java class.
- Wire the plugin into the
openaev-apimodule build configuration.
File summaries
| File | Description |
|---|---|
pom.xml |
Adds the new openaev-maven-plugin module to the multi-module build. |
openaev-api/src/main/resources/application.properties |
Adds a configurable Flyway out-of-order setting. |
openaev-api/pom.xml |
Declares the new plugin in the API module build. |
openaev-maven-plugin/pom.xml |
Introduces the Maven plugin module POM and dependencies. |
openaev-maven-plugin/README.md |
Documents installing and running the new migration template goal. |
openaev-maven-plugin/src/main/java/io/openaev/migration/GenerateNewMigrationTemplateFile.java |
Implements the plugin Mojo that generates a migration template file. |
openaev-maven-plugin/src/main/java/io/openaev/migration/ClassNameGenerator.java |
Generates timestamped Flyway class names. |
openaev-maven-plugin/src/main/java/io/openaev/migration/ClassFileWriter.java |
Writes the generated Java file to disk. |
openaev-maven-plugin/src/main/java/io/openaev/migration/ClassContentsGenerator.java |
Generates the contents of the templated migration class. |
openaev-maven-plugin/src/test/java/io/openaev/migration/GenerateNewMigrationTemplateFileTest.java |
Adds basic tests for file generation and invalid base directory handling. |
Copilot's findings
- Files reviewed: 9/9 changed files
- Comments generated: 10
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (2.88%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6316 +/- ##
============================================
+ Coverage 43.74% 43.76% +0.01%
- Complexity 7205 7208 +3
============================================
Files 2289 2289
Lines 63185 63185
Branches 8421 8420 -1
============================================
+ Hits 27641 27651 +10
+ Misses 33780 33749 -31
- Partials 1764 1785 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
|
Nice change. Could you also update the docs to explain the new naming convention? The current ones still describe the old sequential numbering. It would be wise to synchronize this with Romuald's PR #6363 so that the migration tools remain consistent with this new schema; I’ve already mentioned this on his PR and tagged your work. |
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
Proposed changes
Testing Instructions
Related issues