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

Baseline migration is always updated when repairing #2025

Closed
AndrasJanurik opened this issue May 24, 2018 · 1 comment
Closed

Baseline migration is always updated when repairing #2025

AndrasJanurik opened this issue May 24, 2018 · 1 comment

Comments

@AndrasJanurik
Copy link

@AndrasJanurik AndrasJanurik commented May 24, 2018

Which version and edition of Flyway are you using?

Community, 5.0.7

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

Java API

Which database are you using (type & version)?

MySQL 5.7

Which operating system are you using?

Windows

What did you do?

called FlyWay.repair()
DbRepair.alignAppliedMigrationsWithResolvedMigrations():
when comparing resolved and applied typeUpdateNeeded is checked
(earlier it was not checked, in 4.2.0, where the method was called repairChecksumsAndDescriptions, therefore this behavior did not occur with 4.2.0)
the resolved type for sql migrations is always SQL (SqlMigrationResolver:149)
the applied type for a baseline migration is always BASELINE
therefore schemaHistory.update() is always called for baseline migrations when calling DbRepair.repair() (and FlyWay.repair())

One possible solution I could recommend (without a thorough knowledge of FlyWay so it might be wrong):
the given baseline description (FlyWay.setBaselineDescription()) could be used in the migration resolver to determine if an sql migration is actually a baseline migration and so the resolved type could then be BASELINE
One problem: the current default value "<< Flyway Baseline >>" is not valid for a windows file name

@axelfontaine axelfontaine added this to the Flyway 5.1.0 milestone May 24, 2018
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue May 24, 2018
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 24, 2018

Good catch. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants