@mikro-orm/core 7.3.0-dev.17 → 7.3.0-dev.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,7 +103,8 @@ export function getOnConflictReturningFields(meta, data, uniqueFields, options,
103
103
  if (p.lazy || p.embeddable) {
104
104
  return false;
105
105
  }
106
- if (p.autoincrement) {
106
+ // a PK missing in the data is generated by the database
107
+ if (p.autoincrement || (p.primary && data[p.name] == null)) {
107
108
  return true;
108
109
  }
109
110
  // for a raw `onConflictFields` fragment we can't introspect which columns form the conflict