mirror of https://github.com/go-gorm/gorm.git
Fix onConflict with non-updatable in associations
This commit is contained in:
parent
f21e35f7c5
commit
e81833fd11
|
@ -314,7 +314,7 @@ func onConflictOption(stmt *gorm.Statement, s *schema.Schema, selectColumns map[
|
|||
if stmt.DB.FullSaveAssociations {
|
||||
defaultUpdatingColumns = make([]string, 0, len(s.DBNames))
|
||||
for _, dbName := range s.DBNames {
|
||||
if v, ok := selectColumns[dbName]; (ok && !v) || (!ok && restricted) {
|
||||
if v, ok := selectColumns[dbName]; (ok && !v) || (!ok && restricted) || !s.FieldsByDBName[dbName].Updatable {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue