I've two sql files , one for oracle and one for mySql database. Path is as follows
db/migration/mysql/V1_1_migration.sql
db/migration/oracle/V1_1_migration.sql
while running the test , I'm getting below error
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Found more than one migration with version 1.1
Offenders:
-> C:\code\service\db-repository\target\classes\db\migration\oracle\V1_1__migration.sql (SQL)
-> C:\code\service\db-repository\target\classes\db\migration\mysql\V1_1__migration.sql (SQL)
Any pointers to resolve this error.
The Flyway locations property needs a {vendor} placeholder, then Spring Boot will work out the directory from the lowercase of the database driver id (h2, mysql, oracle, etc), e.g.:
spring.flyway.locations=db/migration,db/migration/{vendor}
In the above example, vendor-agnostic scripts can go in db/migration and vendor-specific ones in db/migration/oracle etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With