go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
36.03k stars 3.86k forks source link

fix replace associations with custom pk #7078

Closed SergeiSadov closed 1 week ago

SergeiSadov commented 1 week ago

What did this pull request do?

This PR fixes the Replace association issue with incorrect ON DUPLICATE KEY UPDATE statement. The example of such issue: https://github.com/go-gorm/playground/pull/745

User Case Description