Flyway disable Delete migrations

Viewed 674

I have a problem with flyway migrations in different versions of my application. For example I have two versions of my project - 1.0 and 2.0. In version 2.0 I have a migration script V1__add_table.sql with content:

CREATE TABLE foo(
    bar boolean
);

When I run my project version 2.0 migration V1__add_table.sql gets applied and I can see it in my flyway_schema_history table with type SQL. Then I go to project version 1.0 and run it. This version of project doesn't contain any migrations so in flyway_schema_history table I get another row added for V1__add_table.sql with type DELETED. The problem is that when I come back to project version 2.0 Flyway tries to execute migration again, but fails because it was already applied.

How could I disable creation of DELETE migrations? I expect that Flyway would just silently ignore migrations, that were already applied checking it with success column.

1 Answers
Related