Flyway 在命名约定中自定义 'version'

Flyway customizing 'version' in naming convention

我正在使用 Flyway 3.2.1。当前属性设置为:

flyway.sqlMigrationPrefix=V
flyway.sqlMigrationSuffix=.sql
flyway.initVersion=0000
flyway.outOfOrder=false

根据documentation版本可以是:

Dots or underscores separate the parts, you can use as many parts as you like

所以我想出了这个V_201509071234_Filename.sql,即使根据examples,我上面的名字应该是有效的。但是,当尝试执行时,它会抱怨:

Flyway Error: org.flywaydb.core.api.FlywayException: Invalid version containing non-numeric characters. Only 0..9 and . are allowed. Invalid version: .201509071234

但是,如果我要在第一个下划线之前添加一个数字,例如 V2_201509071234_Filename.sql,它会起作用。

如何强制 Flyway 接受 V_201509071234_Filename.sql 作为有效名称?

设置前缀为V_,分隔符为_,应该就可以了(希望如此)

此名称将符合 flyway 约定:V201509071234_Filename.sql(V 和版本号之间没有下划线)。