diff --git a/scope_private.go b/scope_private.go index 4ecefe3a..63fcea46 100644 --- a/scope_private.go +++ b/scope_private.go @@ -475,7 +475,7 @@ func (scope *Scope) createTable() *Scope { } if field.IsPrimaryKey { - primaryKeys = append(primaryKeys, field.DBName) + primaryKeys = append(primaryKeys, scope.Quote(field.DBName)) } scope.createJoinTable(field) }