Flyway 在命名约定中自定义“版本”

Sus*_*ire 3 sql flyway

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

flyway.sqlMigrationPrefix=V
flyway.sqlMigrationSuffix=.sql
flyway.initVersion=0000
flyway.outOfOrder=false
Run Code Online (Sandbox Code Playgroud)

根据文档版本可以是:

Dots or underscores separate the parts, you can use as many parts as you like
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

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

Flyway 错误:org.flywaydb.core.api.FlywayException:包含非数字字符的无效版本。只有 0..9 和 . 被允许。无效版本:.201509071234

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

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

Axe*_*ine 5

将前缀设置为 V_ 并将分隔符设置为 _ 应该没问题(我希望)

  • 在错误消息中,有问题的迁移尚未执行。将目标设置为当前或先运行迁移,你应该没问题。 (2认同)