Flyway 3.0 to 4.0 upgrade fails (at least for Postgres)
<p>We tried to go directly from Flyway 3.0 to 4.0 to get access to Repeatable Migrations. (Thus skipping versions 3.1 and 3.2.)</p>

<p>The SQL run via <code>MetaDataTableImpl.upgradeIfNecessary</code> drops the indexes <code>schema_version_vr_idx</code> and <code>schema_version_ir_idx</code> which did not exist in version 3.0's schema, so Postgres is not happy.</p>

<p>A way to support serveral version upgrade could be to use <code>DROP INDEX IF EXISTS schema_version_vr_idx;</code>, but that needs to be adopted to the different databases of course.</p>

<p>For now I solved the problem by creating these two indexes before running Flyway to upgrade the schema.</p>

<p>Is there a better way to do it?</p>