Skip to content

chore(database): add option to enable out of order flyway migrations (#5281)#6316

Merged
antoinemzs merged 21 commits into
mainfrom
fix/ooo_flyway
Jun 29, 2026
Merged

chore(database): add option to enable out of order flyway migrations (#5281)#6316
antoinemzs merged 21 commits into
mainfrom
fix/ooo_flyway

Conversation

@antoinemzs

Copy link
Copy Markdown
Member

Proposed changes

  • New option for out-of-order migrations (disabled by default)
  • New maven plugin for easily create a new timestamped migration file

Testing Instructions

  1. Step-by-step how to test
  2. Environment or config notes

Related issues

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>
Copilot AI review requested due to automatic review settings June 19, 2026 13:49
@antoinemzs antoinemzs changed the title chore(database): add option to enable out of order flyway migrations chore(database): add option to enable out of order flyway migrations (#5281) Jun 19, 2026
@github-actions github-actions Bot added the filigran team Item from the Filigran team. label Jun 19, 2026
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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-order configuration (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-api module 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.

Comment thread openaev-api/pom.xml
Comment thread openaev-api/pom.xml
Comment thread openaev-api/src/main/resources/application.properties
Comment thread openaev-api/src/main/resources/application.properties
Comment thread openaev-maven-plugin/pom.xml Outdated
Comment thread openaev-api/src/main/resources/application.properties
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.76%. Comparing base (20736a4) to head (bcfcd62).

❌ 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     
Flag Coverage Δ
backend 66.38% <ø> (+0.01%) ⬆️
e2e 18.50% <ø> (+0.13%) ⬆️
frontend 2.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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>
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
@laugiov

laugiov commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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.
-> Romuald will wait the merge of your PR ;)

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>
@antoinemzs antoinemzs merged commit 67f4102 into main Jun 29, 2026
36 checks passed
@antoinemzs antoinemzs deleted the fix/ooo_flyway branch June 29, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(flyway): switch to timestamp-based migration versioning to prevent branch conflicts

3 participants