Search code examples
mysqlspringspring-bootmicroservicesflyway

Flyway scripts failing with two schema_version tables in a single schema[Resolved ]


I have two micro services (Consider A and B) are using same database schema with separate schema version tables schema_version_a ,schema_version_b.

Whenever microservice A is creating schema_version_a and executing flyway secripts successfully , microservice B is failing and vice versa.

As I am using flyway 5 schema_version_a table's 1st entry is

1   1.0 init    SQL V1_0__init.sql  -157200059  root    2020-01-06 16:06:41 3905    1

which is correct , but for Mircoservice B schema_version_b entry is as per flyway 3.

 '1', '1', '<< Flyway Baseline >>', 'BASELINE', '<< Flyway Baseline >>', NULL, 'root', '2020-01-06 16:08:20', '0', '1'

Can anyone explain why this is happening ?


Solution

  • Using baselineVersion property for flyway resolved the issue