Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flyway "Wrong migration name format"

Tags:

flyway

We were using a previous 1.7 version of flyway and are trying to upgrade to 2.3. The new flyway seems to not like the format of our migration file names. Is there a way to configure flyway to use a pattern such as this:

00001.US9299.util.util.carete.base.schema.1.sql
00002.US9299.util.util.carete.base.schema.2.sql
00003.Extra.util.add.drop.tables.with.schema.sql

instead of having to rename hundreds of pre-existing migration files to fit the

1_2__Description.sql

pattern?

like image 906
TreverW Avatar asked Apr 18 '14 23:04

TreverW


1 Answers

Flyway 3.0 (due out tomorrow) will let you configure the separator. You can then change the default __ to . to suit your naming convention.

There is however no direct upgrade path from 1.X to 3.0 as the metadata table format changed in 2.X.

Users are advised to do an upgrade to 2.3 first, which will migrate the metadata table automatically, before migrating to 3.0.

In your case that won't work automatically due to the non-standard naming. You will have to convert your metadata table manually as a one-off as part of the upgrade. To help you get started with this, you can take the regular upgrade scripts packaged with Flyway 2.3 as a base.

like image 155
Axel Fontaine Avatar answered Nov 25 '22 14:11

Axel Fontaine