Flyway自定义命名约定中的“版本" [英] Flyway customizing 'version' in naming convention

查看:769
本文介绍了Flyway自定义命名约定中的“版本"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using Flyway 3.2.1. Current properties are set to:

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

根据文档版本可以是:

According to the documentation, version can be:

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

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

Therefore I came up with this V_201509071234_Filename.sql, even according to examples, my name above should be valid. However when attempting to execute, it complains:

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

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,它将起作用.

However, if I were to add a number before first underscore, like so, V2_201509071234_Filename.sql, it works.

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

How can I force Flyway to accept V_201509071234_Filename.sql as a valid name?

推荐答案

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

Set the prefix the be V_ and the separator to be _ and it should be OK (I hope)

这篇关于Flyway自定义命名约定中的“版本"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆