question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flyway 7 Breaking Changes Announcements

See original GitHub issue

Flyway 7 is released!

Flyway 7 has now been released. You can find the official list of the breaking changes in the release notes: https://flywaydb.org/documentation/releaseNotes#7.0.0.

The text below is possibly out of date now. I’ll keep it for posterity. Refer to the release notes for the complete information.


Flyway 7 is due roughly in the summer of this year. We plan to make the following breaking changes on the first version 7 release:

Platform support

Breaking changes

  • Non-existent locations in flyway.locations will produce errors instead of warnings
  • Use of dots (.) as path separators in flyway.locations will be deprecated and produce an error when used
  • MigrationType.SPRING_JDBC and MigrationType.UNDO_SPRING_JDBC will be removed
    • Use MigrationType.JDBC and MigrationType.UNDO_JDBC instead
  • In order to support JSON output we’ll need to change the return types of public methods in the Flyway class
  • Placeholder names will become case insensitive
  • Flyway command line will no longer load config files from standard input, but instead require a - to be passed to the configFiles argument

Comments and questions are welcome. This post will be updated with more changes in the run up to version 7.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MikielAgutucommented, May 5, 2020

@cowwoc Internally, paths that began with classpath: have dots replaced with slashes. So a location like this:

classpath:path.to.my.migration

Is converted internally to:

classpath:path/to/my/migration

Such paths will produce an error in V7.

The code is in Location.java.

1reaction
stellingsimoncommented, Mar 15, 2020

Thanks for announcing these changes early on and allowing us to comment.

Non-existent locations in flyway.locations will produce errors instead of warnings

As long as these locations may be empty without Flyway considering that to be an error, this is a great idea. I lost countless hours to debugging Flyway only to find out I had a typo in one of the locations.

Zooming out a little, though, it feels like a breach with the concept of “dynamic discovery” currently used:

As it is now, it feels to me like Flyway is trying to be “smart” with information about the migrations being decentralized, so locations was always interpreted as “look in these places and figure out what to do”.

(Many disliked this “smartness”, including me, see #2698, #2541, #2610, #2647, #2683, …)

In contrast, it could be “dumb”, with information about the migrations being centralized, so instead of locations I provide a MigrationManifest to Flyway, telling it exactly what to do in which order with which options. In this world, it better report errors at the first ambiguity.

By being strict on “locations” (which is one of the few centralized configuration points), Flyway somewhat limits the ways I interact with it. For example, we currently have just one Flyway configuration for both production and setups with a test fixture:

locations=classpath:migrations/prod,classpath:migrations/testfixture

Since we make sure not to include demo-data in a production setup, there is no need to have two different Flyway configurations. So with Flyway 7.0, we’ll either have to make structural changes to our deployment setup. Providing an empty classpath:migrations/textfixture in production JARs just to make Flyway happy looks tempting but would ultimately lead to people accidentally placing files there.

In conclusion, I’d like the following most:

  • a “smart” mode with a lenient location configuration parameter, where Flyway is expected to be “smart”, trying its best but not failing.
  • a “dumb” mode with a non-lenient MigrationManifest configuration parameter, where Flyway is given precise instructions and thus failing as soon as it detects those instructions to be nonsensical.

Lacking that, I’d wish for a configuration option treatMissingLocationAsError with a default value of true.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release Notes - Flyway by Redgate • Database Migrations ...
Breaking changes. Migration patterns that are version numbers are treated as numbers rather than strings when matching to migrations; Script & Java ...
Read more >
Flyway Blog
The Flyway Blog - news and releases from the Flyway development team.
Read more >
Flyway 7.0.0 Released
It contains many new features and improvements over Flyway 6.5.7. ... You can find a detailed list of the changes in the release...
Read more >
Flyway 7.0.0 Beta
After much work, we're proud to announce we are releasing an early-access beta version of Flyway V7, which has a slew of big...
Read more >
Upcoming Features For Flyway - Redgate Software
Changes · Generate undo migration scripts · Only pending migrations shown on migrations tab · Verify database migration scripts · Initialize local Git...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found