简体   繁体   English

Symmetric DS 不同的 PK 但相同的唯一分辨率

[英]Symmetric DS different PK but same unique resolution

We have this MySQL table:我们有这个 MySQL 表:

id BINARY PRIMARY KEY, -- this is actually GUID
position INT NOT NULL UNIQUE
some_value VARCHAR(200)

On each of two nodes, users create a new entry but with the same position:在两个节点中的每一个上,用户创建一个新条目,但具有相同的 position:

id=0x01
position=5
some_value = "first node entry"

id=0x02
position=5
some_value = "second node entry"

I want to sync this by unique key and not by PK.我想通过唯一键而不是 PK 同步它。

How can I do that?我怎样才能做到这一点?

Either of these two entries is accepted as the final result.这两个条目中的任何一个都被接受为最终结果。 The question is only about how to set up SymmetricDS to sync in this case.问题只是关于在这种情况下如何设置 SymmetricDS 进行同步。

It was enough to set sync_key_names="position" in table sym_trigger.在表 sym_trigger 中set sync_key_names="position"就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM