I am trying to use Flyway for a modular application database version. Each module has its own separate set of tables and migration scenarios that will control versions of this set of tables.
Flyway allows me to specify a different metadata table for each module - so I can deploy each module myself. When I try to update the application, I start the migration process for each module, each with its own table and set of scripts. Please note that these tables are in the same layout.
However, when I try to migrate my application, the first migration is the only one that works. Subsequent migrations fail with the following exception: org.flywaydb.core.api.FlywayException: Found non-empty schema(s) "public" without metadata table! Use baseline() or set baselineOnMigrate to true to initialize the metadata table. org.flywaydb.core.api.FlywayException: Found non-empty schema(s) "public" without metadata table! Use baseline() or set baselineOnMigrate to true to initialize the metadata table.
If I manually create a metadata table for each module, the migration for each module works correctly. Creating the table itself, rather than creating the Flyway for me, seems like a hack to the problem, not a solution in itself.
Is this a legitimate way to manage multiple sets of tables yourself, or is there a better way to do this? Is this the right way to create a metadata table?
source share