Found more than one migration with version n (after switching from version 7.11.4 to the latest)
See original GitHub issueWhich version and edition of Flyway are you using?
7.12.0
If this is not the latest version, can you reproduce the issue with the latest one as well? (Many bugs are fixed in newer releases and upgrading will often resolve the issue)
same problem with 7.15.0
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Maven plugin
Which database are you using? (Type & version)
PostgreSql 42.2.23 (production) and H2 1.4.200 (testing)
Which operating system are you using?
Windows
What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)
This is one of many integration tests that fail.
@SpringBootTest
@Transactional
class CatalogControllerTest {
@Autowired
private WebApplicationContext applicationContext;
@Autowired
private aRepository aRepository;
private MockMvc mockMvc;
@BeforeEach
void setup() {
this.mockMvc = MockMvcBuilders .webAppContextSetup(applicationContext).build();
}
@Test
void get_OK() throws Exception {
aRepository.save(anyDTO);
this.mockMvc.perform(
get("endpoint/...")
.andExpect(status().isOk());
}
}
NOTE up to version 7.11.4 I didn’t have any problems
What did you expect to see?
I expected flyway to perform migrations correctly
What did you see instead?
I received the following exception:
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
Offenders:
-> ...\target\classes\db\migration\V1__table.sql (SQL)
-> ...\target\test-classes\db\migration\V1__table.sql (SQL) (override)
For reasons of compatibility with H2, I need to override some scripts in the folder test/resources/db/migrations
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Flyway Found more than one migration with version
The Flyway locations property needs a {vendor} placeholder, then Spring Boot will work out the directory from the lowercase of the database ...
Read more >Release Notes for Flyway Engine - Documentation
Breaking changes. Migration patterns that are version numbers are treated as numbers rather than strings when matching to migrations; Script & ...
Read more >Issue 94 in flyway: "Found more than one migration" error for ...
In such a case, Flyway complains: Found more than one migration with version: X at com.googlecode.flyway.core.migration.MigrationProvider.
Read more >Confluence 7.11 Upgrade Notes - Atlassian Documentation
If your version of Confluence is more than one version behind, read the release notes and upgrade guides for all releases between your...
Read more >2.16. Version 6.4 - Documentation
This Squish version introduces a new, more powerful scheme for expressing and managing object names: Script-Based Object Maps. Instead of using strings ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Likely related to https://github.com/flyway/flyway/issues/3359#issuecomment-998164826 where the same suggested solution will apply
This you see below is the only configuration class
We use the default flyway folder as the location. Maybe I should add something to the configuration file?
Thanks