@nocobase/database 1.7.0-beta.5 → 1.7.0-beta.6
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/lib/collection.js
CHANGED
|
@@ -287,9 +287,20 @@ const _Collection = class _Collection extends import_events.EventEmitter {
|
|
|
287
287
|
if (!field) {
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
|
-
if (options.type
|
|
291
|
-
|
|
290
|
+
if (options.type === field.type) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const isContextTypeMatch = /* @__PURE__ */ __name((data, dataType) => {
|
|
294
|
+
var _a, _b;
|
|
295
|
+
return [(_a = data.dataType) == null ? void 0 : _a.key, (_b = data.type) == null ? void 0 : _b.toUpperCase()].includes(dataType == null ? void 0 : dataType.toUpperCase());
|
|
296
|
+
}, "isContextTypeMatch");
|
|
297
|
+
if (options.type === "context" && isContextTypeMatch(field, options.dataType)) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
if (field.type === "context" && isContextTypeMatch(options, field.dataType.key)) {
|
|
301
|
+
return;
|
|
292
302
|
}
|
|
303
|
+
throw new Error(`fields with same column must be of the same type ${JSON.stringify(options)}`);
|
|
293
304
|
}
|
|
294
305
|
/**
|
|
295
306
|
* @internal
|
|
@@ -56,7 +56,7 @@ var import_relation_repository = require("./relation-repository");
|
|
|
56
56
|
const _BelongsToManyRepository = class _BelongsToManyRepository extends import_multiple_relation_repository.MultipleRelationRepository {
|
|
57
57
|
async aggregate(options) {
|
|
58
58
|
const targetRepository = this.targetCollection.repository;
|
|
59
|
-
const sourceModel = await this.getSourceModel();
|
|
59
|
+
const sourceModel = await this.getSourceModel(await this.getTransaction(options));
|
|
60
60
|
const association = this.association;
|
|
61
61
|
return await targetRepository.aggregate({
|
|
62
62
|
...options,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/database",
|
|
3
|
-
"version": "1.7.0-beta.
|
|
3
|
+
"version": "1.7.0-beta.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"license": "AGPL-3.0",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/logger": "1.7.0-beta.
|
|
10
|
-
"@nocobase/utils": "1.7.0-beta.
|
|
9
|
+
"@nocobase/logger": "1.7.0-beta.6",
|
|
10
|
+
"@nocobase/utils": "1.7.0-beta.6",
|
|
11
11
|
"async-mutex": "^0.3.2",
|
|
12
12
|
"chalk": "^4.1.1",
|
|
13
13
|
"cron-parser": "4.4.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
39
39
|
"directory": "packages/database"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "4f1d3fa20b508322cc063b424588123e4ecc1c5f"
|
|
42
42
|
}
|