Flyway脚本在单个模式中出现两个schema_version表格时失败[已解决]

huangapple go评论87阅读模式
英文:

Flyway scripts failing with two schema_version tables in a single schema[Resolved ]

问题

我有两个微服务(考虑A和B),它们使用相同的数据库架构,但有单独的架构版本表schema_version_a和schema_version_b。

每当微服务A创建schema_version_a并成功执行Flyway脚本时,微服务B会失败,反之亦然。

由于我使用的是Flyway 5,schema_version_a表的第一个条目是

1 1.0 init SQL V1_0__init.sql -157200059 root 2020-01-06 16:06:41 3905 1

这是正确的,
但对于微服务B,schema_version_b的条目与Flyway 3的版本相符。

'1','1','<< Flyway Baseline >>','BASELINE','<< Flyway Baseline >>',NULL,'root','2020-01-06 16:08:20','0','1'

有人可以解释为什么会发生这种情况吗?

英文:

I have two micro services (Consider A and B) are using same database schema with separate schema version tables schema_version_a ,schema_version_b.

Whenever microservice A is creating schema_version_a and executing flyway secripts successfully , microservice B is failing and vice versa.

As I am using flyway 5 schema_version_a table's 1st entry is

1	1.0	init	SQL	V1_0__init.sql	-157200059	root	2020-01-06 16:06:41	3905	1

which is correct ,
but for Mircoservice B schema_version_b entry is as per flyway 3.

 &#39;1&#39;, &#39;1&#39;, &#39;&lt;&lt; Flyway Baseline &gt;&gt;&#39;, &#39;BASELINE&#39;, &#39;&lt;&lt; Flyway Baseline &gt;&gt;&#39;, NULL, &#39;root&#39;, &#39;2020-01-06 16:08:20&#39;, &#39;0&#39;, &#39;1&#39;

Can anyone explain why this is happening ?

答案1

得分: 0

使用baselineVersion属性解决了flyway的问题。

英文:

Using baselineVersion property for flyway resolved the issue

huangapple
  • 本文由 发表于 2020年1月6日 18:51:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/59610775.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定