@mikro-orm/sql 7.1.5-dev.12 → 7.1.5-dev.14

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/sql",
3
- "version": "7.1.5-dev.12",
3
+ "version": "7.1.5-dev.14",
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
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.1.4"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.1.5-dev.12"
56
+ "@mikro-orm/core": "7.1.5-dev.14"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -39,7 +39,11 @@ export class ObjectCriteriaNode extends CriteriaNode {
39
39
  throw new Error('Mixing collection operators with other filters is not allowed.');
40
40
  }
41
41
  const payload = this.payload[key].unwrap();
42
- const qb2 = qb.clone(true, ['schema']);
42
+ // entities with a fixed schema must resolve the `from` table's own schema in the subquery,
43
+ // otherwise a nested operator inherits the root entity's schema (GH #7894); for wildcard or
44
+ // schema-less entities the schema is resolved dynamically and needs to be carried over
45
+ const fixedSchema = parentMeta.schema && parentMeta.schema !== '*';
46
+ const qb2 = qb.clone(true, fixedSchema ? undefined : ['schema']);
43
47
  const joinAlias = qb2.getNextAlias(this.prop.targetMeta.class);
44
48
  const sub = qb2
45
49
  .from(parentMeta.class)