@mikro-orm/knex 6.4.11-dev.2 → 6.4.11-dev.3

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.
@@ -731,12 +731,16 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
731
731
  await this.rethrow(this.execute(kqb));
732
732
  continue;
733
733
  }
734
- /* istanbul ignore next */
735
734
  const pivotMeta = this.metadata.find(coll.property.pivotEntity);
736
735
  let schema = pivotMeta.schema;
737
736
  if (schema === '*') {
738
- const ownerSchema = wrapped.getSchema() === '*' ? this.config.get('schema') : wrapped.getSchema();
739
- schema = coll.property.owner ? ownerSchema : this.config.get('schema');
737
+ if (coll.property.owner) {
738
+ schema = wrapped.getSchema() === '*' ? options?.schema ?? this.config.get('schema') : wrapped.getSchema();
739
+ }
740
+ else {
741
+ const targetMeta = coll.property.targetMeta;
742
+ schema = targetMeta.schema === '*' ? options?.schema ?? this.config.get('schema') : targetMeta.schema;
743
+ }
740
744
  }
741
745
  else if (schema == null) {
742
746
  schema = this.config.get('schema');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.4.11-dev.2",
3
+ "version": "6.4.11-dev.3",
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.4.10"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.4.11-dev.2",
69
+ "@mikro-orm/core": "6.4.11-dev.3",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"