@mikro-orm/knex 6.0.0-dev.283 → 6.0.0-dev.285

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.
@@ -237,7 +237,8 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
237
237
  for (const prop of targetProps) {
238
238
  if (prop.fieldNames.length > 1) { // composite keys
239
239
  const fk = prop.fieldNames.map(name => root[`${relationAlias}__${name}`]);
240
- relationPojo[prop.name] = core_1.Utils.mapFlatCompositePrimaryKey(fk, prop);
240
+ const pk = core_1.Utils.mapFlatCompositePrimaryKey(fk, prop);
241
+ relationPojo[prop.name] = pk.every(val => val != null) ? pk : null;
241
242
  }
242
243
  else if (prop.runtimeType === 'Date') {
243
244
  const alias = `${relationAlias}__${prop.fieldNames[0]}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.0.0-dev.283",
3
+ "version": "6.0.0-dev.285",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -66,6 +66,6 @@
66
66
  "@mikro-orm/core": "^5.0.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.0.0-dev.283"
69
+ "@mikro-orm/core": "6.0.0-dev.285"
70
70
  }
71
71
  }