Open micheal-hill opened 6 years ago
Not that I know of. Do you have a test migration (preferably for H2) that I can use?
Working with a single migration, with the option flywayIgnoreMissingMigrations
explicitly set to false
(which appears to be the default, anyway).
In file V20181018__create_foo.sql
:
CREATE TABLE test_user (
name VARCHAR(25) NOT NULL,
PRIMARY KEY(name)
);
Running the migration works without issue. However, if I delete the migration file after it has been run and try to run the migrations again, I only receive a warning and the migration task passes without error.
Researching this issue; it appears that the flyway option ignoreFutureMigrations
produces the behavior I'm looking for when I use the CLI tool. However, I couldn't get the sbt version of this option to work as I expected (it didn't seem to have any affect). For now, I will use the flyway CLI tool as it appears to do what I need.
Thanks! I'll make a test case and dig in to it.
I have refactored the logic for setting migration parameters. Seems that ignoreFutureMigrations
setting got lost in some deprecation. Can you check if the fail-on-error
branch fixes this? You can sbt publishLocal
and use 5.2.1-SNAPSHOT
for the plugin version. If this fails, I will set up a more complex test case against a persistent database.
I'm trying to have flyway/sbt produce an error (rather than a warning) when migrations are missing, but I haven't been able to find any options that would present this behavior. Specifically, I would like sbt to exit with a non-zero exit status if a migration is missing - the same behavior as when a migration has been modified after apply.
Is there some setting/configuration that I can change to do this?