Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otter能根据唯一索引同步吗?想规避自增主键冲突的问题 #1115

Open
quanllong opened this issue Sep 22, 2023 · 2 comments
Open

Comments

@quanllong
Copy link
Contributor

quanllong commented Sep 22, 2023

源库和目标库在同步之前就有一些历史数据,主键是自增ID,如果按照主键同步会造成数据覆盖,我理解otter之所以要有主键是为了区分唯一的一行数据,所以我在想能不能用唯一索引代替主键

@xue2lang
Copy link

xue2lang commented Nov 1, 2023

修改MessageParse中部分代码就可以实现,优先级:PK—>UK,同时映射关系剔除主键即可

@AnnYeLi
Copy link

AnnYeLi commented Nov 1, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants