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 only applied on complete empty schemas #3767
Comments
Hi @Auskennfuchs , based on the info posted here https://documentation.red-gate.com/fd/baseline-migrations-184127465.html, |
Also, according to https://documentation.red-gate.com/fd/baseline-on-migrate-224919695.html, when |
Hello Jason, |
Hi @Auskennfuchs , let's walk through both your scenarios: Running on an
Running on an
|
Which version and edition of Flyway are you using?
flyway-core 9.22.3 community edition
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)
yes
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Java API
Which database are you using? (Type & version)
IBM DB2
Which operating system are you using?
Linux
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)
I'm sharing one schema with multiple flyway migrations. Each migration maintains an independent set of tables. Everything is working and each flyway migration has it's own flyway history table. Now I'm trying to add baselining to the migrations to speed up the initialization of new databases.
I have this simple scenario:
The schema, where the migration is running is not empty, so other tables are already existing because of previously running migrations.
My flyway is configured like this:
The scripts are correctly parsed:
So Flyway correctly identifies
V1.0
andV1.1
as below the newest baseline. But still these scripts are executed andB2.0
is ignored completely.When I'm running the same Migration on an empty schema everything works like expected,
B2.0
andV2.1
are execucted andV1.x
are ignored. In every case I'm providing thebaselineVersion
as0
.What did you expect to see?
I would expect that also on not empty schemas the baseline is correctly used.
What did you see instead?
The baseline version is ignored on non empty schemas. Even when I'm setting the baselineVersion to
2
or1.9
the baseline script is never executed.I assume there were some decisions that only empty schemas can guarantee the proper baseline with flyway, but in some scenarios this may not apply. It would be good to have an option that the baseline is still applied, as long as the flyway history table doesn't exist.
The text was updated successfully, but these errors were encountered: