@nocobase/database 2.0.0-alpha.35 → 2.0.0-alpha.36
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 +12 -2
- package/package.json +4 -4
package/lib/collection.js
CHANGED
|
@@ -668,11 +668,21 @@ const _Collection = class _Collection extends import_events.EventEmitter {
|
|
|
668
668
|
*/
|
|
669
669
|
refreshIndexes() {
|
|
670
670
|
const indexes = this.model._indexes;
|
|
671
|
+
const attributes = {};
|
|
672
|
+
for (const [name, field] of Object.entries(this.model.getAttributes())) {
|
|
673
|
+
attributes[this.normalizeFieldName(name)] = field;
|
|
674
|
+
}
|
|
671
675
|
this.model._indexes = import_lodash.default.uniqBy(
|
|
672
676
|
indexes.filter((item) => {
|
|
673
|
-
return item.fields.every((field) =>
|
|
677
|
+
return item.fields.every((field) => {
|
|
678
|
+
const name = this.normalizeFieldName(field);
|
|
679
|
+
return attributes[name];
|
|
680
|
+
});
|
|
674
681
|
}).map((item) => {
|
|
675
|
-
item.fields = item.fields.map((field) =>
|
|
682
|
+
item.fields = item.fields.map((field) => {
|
|
683
|
+
const name = this.normalizeFieldName(field);
|
|
684
|
+
return attributes[name].field;
|
|
685
|
+
});
|
|
676
686
|
return item;
|
|
677
687
|
}),
|
|
678
688
|
"name"
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/database",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.36",
|
|
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": "2.0.0-alpha.
|
|
10
|
-
"@nocobase/utils": "2.0.0-alpha.
|
|
9
|
+
"@nocobase/logger": "2.0.0-alpha.36",
|
|
10
|
+
"@nocobase/utils": "2.0.0-alpha.36",
|
|
11
11
|
"async-mutex": "^0.3.2",
|
|
12
12
|
"chalk": "^4.1.1",
|
|
13
13
|
"cron-parser": "4.4.0",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
40
40
|
"directory": "packages/database"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "c1170bac3ba2325b7420ce65e732c1ba8bbb7767"
|
|
43
43
|
}
|