关于使用schema_version表的Flyway 5.0.7警告 [英] Flyway 5.0.7 warning about using schema_version table

查看:561
本文介绍了关于使用schema_version表的Flyway 5.0.7警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Flyway Gradle插件离线进行迁移(即,在系统关闭时进行迁移)。我们最近升级到Flyway 5.0.7,现在看到迁移警告:



找不到架构历史记录表 XXXXXXX flyway_schema_history ,但找到了 XXXXXXX schema_version 代替。您之所以会看到此消息,是因为Flyway在5.0.0版中将flyway.table的默认值更改为flyway_schema_history,而您仍在依靠旧的默认值(schema_version)。在您的配置中设置flyway.table = schema_version可以解决此问题。此后备机制将在Flyway 6.0.0中删除。



(我使用XXXXXXX遮盖了实际的架构名称)。



因此,似乎可以通过设置flyway.table = schema_version避免该错误。但是,它还说该机制将在Flyway 6.0.0中删除。



我们是否应该做一些事情来使这种兼容向前发展?我们是否必须手动将schema_version表重命名为flyway_schema_history?还是有办法让Flyway做到这一点?如果没有,当Flyway 6.0.0推出时会发生什么?

解决方案

flyway.table <的默认值已从 schema_version 更改为 flyway_schema_history 。并且他们还提供了自动回退到旧默认设置的警告,以避免使用旧默认设置破坏现有安装。



这表示从第5航路出发,如果未指定<配置文件中的code> flyway.table 属性,然后flyway将在db中查找表 flyway_schema_history ,如果找不到该表将查找表 schema_version 作为后备,如果找到了旧表,则会警告您现在得到的消息。此后备机制将从飞行路线6中删除。如果不提供 flyway.table 属性,它将在db中查找 flyway_schema_history ,如果找不到,则不会即使有表,也要查找 schema_version 表,并将创建一个名为 flyway_schema_history 的新表以维护功能。



在flyway 6中,如果设置 flyway.table = schema_version ,则现有系统将运行良好,无需更改db中的表名。但是,如果未设置该属性,则必须更改表名,否则flyway将无法识别现有的schema_version表,将系统视为新表,将创建flyway_schema_history表并从头开始执行脚本。 / p>

希望它会有所帮助。


We use the Flyway Gradle plugin to do our migrations offline (i.e. we migrate while the system is down). We recently upgraded to Flyway 5.0.7 and we see this warning now for migrations:

Could not find schema history table XXXXXXX.flyway_schema_history, but found XXXXXXX.schema_version instead. You are seeing this message because Flyway changed its default for flyway.table in version 5.0.0 to flyway_schema_history and you are still relying on the old default (schema_version). Set flyway.table=schema_version in your configuration to fix this. This fallback mechanism will be removed in Flyway 6.0.0.

(I've used the XXXXXXX to obscure the actual schema name).

So, it appears that we can avoid the error by setting flyway.table=schema_version. But, it also says this mechanism will be removed in Flyway 6.0.0.

Are we supposed to do something to make this compatible going forward? Do we have to manually rename the schema_version table to flyway_schema_history? Or is there a way to make Flyway do it? If not, what is going to happen when Flyway 6.0.0 comes out? Will it automatically migrate the data to the appropriate table name?

解决方案

The default for flyway.table has been changed from schema_version to flyway_schema_history. And they have also provided automatic fallback to old default with a warning to avoid breaking existing installations using the old default.

It means from flyway 5, If you do not specify flyway.table property inside your configuration file, then flyway will look for the table flyway_schema_history in db, and if not found it will look for the table schema_version as a fallback and if the old table is found then will warn with the message that you are getting now. From flyway 6, this fallback mechanism will be removed. If you do not provide flyway.table property, it will look for flyway_schema_history in db, if not found it will not look for schema_version table even if you have any and will create a new table named flyway_schema_history to maintain functionality.

In flyway 6, your existing system will run fine if you set flyway.table=schema_version, you do not need to change table name in db. But if you do not set the property, then you must have to change the table name, otherwise flyway will not recognize existing schema_version table, will treat the system as a new one, will create flyway_schema_history table and will start executing scripts from start.

Hoping it will help.

这篇关于关于使用schema_version表的Flyway 5.0.7警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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