Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting sqlMigrationPrefix to empty causes error "Found more than one repeatable migration with description" since 6.3.0+ #2819

Closed
angusholder opened this issue May 18, 2020 · 0 comments
Assignees
Milestone

Comments

@angusholder
Copy link

@angusholder angusholder commented May 18, 2020

Which version and edition of Flyway are you using?

Community 6.4.2, but bug seems to happen on releases after 6.2.4 (6.2.4 worked. 6.3.0, 6.3.3, and 6.4.2 didn't)

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command-line

Which database are you using (type & version)?

h2-1.4.200

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 that failed (if relevant) and the command you ran.)

I set sqlMigrationPrefix to be empty, (as in I name my migrations like 0__create_table.sql, 1__add_column.sql)

Here's a minimal reproduction:

bug_repro.zip

The repro uses 6.3.3, but 6.3.0, 6.3.3, and 6.4.2 all fail, and 6.2.4 works

What did you expect to see?

It should accept the R__foo_table.sql with no issue, which is what happens in 6.2.4

What did you see instead?

Running flyway info exits with "Found more than one repeatable migration with description foo table", listing the exact same file path twice.

Here's the full debug output:

DEBUG: Loading config file: C:\proj\sql-schema\bug_repro\conf\flyway.conf
DEBUG: Unable to load config file: C:\Users\Angus\flyway.conf
DEBUG: Unable to load config file: C:\proj\sql-schema\bug_repro\flyway.conf
DEBUG: Using configuration:
DEBUG: flyway.jarDirs -> C:\proj\sql-schema\bug_repro\jars
DEBUG: flyway.locations -> filesystem:C:\proj\sql-schema\bug_repro\sql
DEBUG: flyway.password -> **********
DEBUG: flyway.sqlMigrationPrefix ->
DEBUG: flyway.url -> jdbc:h2:mem:testdb
DEBUG: flyway.user -> myuser
DEBUG: Adding location to classpath: C:\proj\sql-schema\bug_repro\drivers\h2-1.4.200.jar
Flyway Community Edition 6.3.3 by Redgate
DEBUG: Scanning for filesystem resources at 'C:\proj\sql-schema\bug_repro\sql'
DEBUG: Scanning for resources in path: C:\proj\sql-schema\bug_repro\sql (C:\proj\sql-schema\bug_repro\sql)
DEBUG: Found filesystem resource: C:\proj\sql-schema\bug_repro\sql\R__foo_table.sql
Database: jdbc:h2:mem:testdb (H2 1.4)
DEBUG: Driver  : H2 JDBC Driver 1.4.200 (2019-10-14)
DEBUG: DDL Transactions Supported: false
DEBUG: Schemas:
DEBUG: Default schema: null
DEBUG: Scanning for SQL callbacks ...
DEBUG: Memory usage: 19 of 245M
ERROR: Unexpected error
org.flywaydb.core.api.FlywayException: Found more than one repeatable migration with description foo table
Offenders:
-> C:\proj\sql-schema\bug_repro\sql\R__foo_table.sql (SQL)
-> C:\proj\sql-schema\bug_repro\sql\R__foo_table.sql (SQL)
        at org.flywaydb.core.internal.resolver.CompositeMigrationResolver.checkForIncompatibilities(CompositeMigrationResolver.java:155)
        at org.flywaydb.core.internal.resolver.CompositeMigrationResolver.doFindAvailableMigrations(CompositeMigrationResolver.java:112)
        at org.flywaydb.core.internal.resolver.CompositeMigrationResolver.resolveMigrations(CompositeMigrationResolver.java:95)
        at org.flywaydb.core.internal.resolver.CompositeMigrationResolver.resolveMigrations(CompositeMigrationResolver.java:46)
        at org.flywaydb.core.internal.info.MigrationInfoServiceImpl.refresh(MigrationInfoServiceImpl.java:130)
        at org.flywaydb.core.internal.command.DbInfo.info(DbInfo.java:52)
        at org.flywaydb.core.Flyway$4.execute(Flyway.java:331)
        at org.flywaydb.core.Flyway$4.execute(Flyway.java:324)
        at org.flywaydb.core.Flyway.execute(Flyway.java:530)
        at org.flywaydb.core.Flyway.info(Flyway.java:324)
        at org.flywaydb.commandline.Main.executeOperation(Main.java:198)
        at org.flywaydb.commandline.Main.main(Main.java:128)
@angusholder angusholder changed the title Setting sqlMigrationPrefix to empty breaks locators for repeatable migrations since 6.3.0+ Setting sqlMigrationPrefix to empty "Found more than one repeatable migration with description" since 6.3.0+ May 18, 2020
@angusholder angusholder changed the title Setting sqlMigrationPrefix to empty "Found more than one repeatable migration with description" since 6.3.0+ Setting sqlMigrationPrefix to empty causes error "Found more than one repeatable migration with description" since 6.3.0+ May 18, 2020
@Lyeeedar Lyeeedar self-assigned this May 19, 2020
@juliahayward juliahayward added this to the Flyway 6.4.3 milestone May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants