@mikro-orm/knex 6.3.5-dev.10 → 6.3.5-dev.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.3.5-dev.10",
3
+ "version": "6.3.5-dev.11",
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,7 +66,7 @@
66
66
  "@mikro-orm/core": "^6.3.4"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.3.5-dev.10",
69
+ "@mikro-orm/core": "6.3.5-dev.11",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -421,12 +421,9 @@ class DatabaseTable {
421
421
  findFkIndex(currentFk) {
422
422
  const fkColumnsLength = currentFk.columnNames.length;
423
423
  const possibleIndexes = this.indexes.filter(index => {
424
- return index.columnNames.length >= fkColumnsLength && !currentFk.columnNames.some((columnName, i) => index.columnNames[i] !== columnName);
424
+ return index.columnNames.length === fkColumnsLength && !currentFk.columnNames.some((columnName, i) => index.columnNames[i] !== columnName);
425
425
  });
426
426
  possibleIndexes.sort((a, b) => {
427
- if (a.columnNames.length !== b.columnNames.length) {
428
- return a.columnNames.length < b.columnNames.length ? -1 : 1;
429
- }
430
427
  if (a.primary !== b.primary) {
431
428
  return a.primary ? -1 : 1;
432
429
  }