@nocobase/database 1.9.3 → 1.9.5

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.
Files changed (2) hide show
  1. package/lib/collection.js +12 -2
  2. package/package.json +4 -4
package/lib/collection.js CHANGED
@@ -662,11 +662,21 @@ const _Collection = class _Collection extends import_events.EventEmitter {
662
662
  */
663
663
  refreshIndexes() {
664
664
  const indexes = this.model._indexes;
665
+ const attributes = {};
666
+ for (const [name, field] of Object.entries(this.model.getAttributes())) {
667
+ attributes[this.normalizeFieldName(name)] = field;
668
+ }
665
669
  this.model._indexes = import_lodash.default.uniqBy(
666
670
  indexes.filter((item) => {
667
- return item.fields.every((field) => this.model.rawAttributes[field]);
671
+ return item.fields.every((field) => {
672
+ const name = this.normalizeFieldName(field);
673
+ return attributes[name];
674
+ });
668
675
  }).map((item) => {
669
- item.fields = item.fields.map((field) => this.model.rawAttributes[field].field);
676
+ item.fields = item.fields.map((field) => {
677
+ const name = this.normalizeFieldName(field);
678
+ return attributes[name].field;
679
+ });
670
680
  return item;
671
681
  }),
672
682
  "name"
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "1.9.3",
3
+ "version": "1.9.5",
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.9.3",
10
- "@nocobase/utils": "1.9.3",
9
+ "@nocobase/logger": "1.9.5",
10
+ "@nocobase/utils": "1.9.5",
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": "e691264453aac97972d2cf18412d5a0228dff361"
42
+ "gitHead": "b65aca61cfcc713b9bee2fec844c00db21cb1f3b"
43
43
  }