testcontainers / testcontainers-jooq-codegen-maven-plugin

jOOQ code generator using Testcontainers
Apache License 2.0
56 stars 9 forks source link

Flyway baseline migration failing test case #36

Closed willsoto closed 11 months ago

willsoto commented 11 months ago

Hey there, great project.

I having been having issues with a single baseline migration and was able to reproduce this as a test case. I have the setting <validateMigrationNaming>true</validateMigrationNaming> so that it fails fast. If you change this to false, nothing will get run since I believe flyway ignores names it doesn't understand by default. I have also set the baselineOnMigrate to true since I believe this is required for this type of setup.

I validated outside of this maven plugin that a single baseline script will work with the programmatic API. For example:

final Flyway flyway =
    Flyway.configure().dataSource(datasource()).baselineOnMigrate(true).load();
flyway.migrate();

Documentation for baseline migrations is here: https://documentation.red-gate.com/fd/baseline-migrations-184127465.html

Possibly related issue but I really don't see a whole lot of logic in this plugin, so I am not sure what could be missing.

willsoto commented 11 months ago

After posting this, I realized the issue was likely due to the flyway version bundled in this plugin is behind the version where baseline migrations were added. This plugin is currently at 9.16.3 and the latest is v10 (latest 9.x series is 9.22.3.

I was able to resolve this by adding a later version of flyway-core to the plugin's <dependencies>.