@nocobase/database 1.4.0-alpha.20241008122235 → 1.4.0-alpha.20241016035453

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.
@@ -140,12 +140,18 @@ const _OptionsParser = class _OptionsParser {
140
140
  sort = sort.split(",");
141
141
  }
142
142
  let defaultSortField = this.model.primaryKeyAttribute;
143
+ if (Array.isArray(this.collection.filterTargetKey)) {
144
+ defaultSortField = this.collection.filterTargetKey;
145
+ }
143
146
  if (!defaultSortField && this.collection.filterTargetKey && !Array.isArray(this.collection.filterTargetKey)) {
144
147
  defaultSortField = this.collection.filterTargetKey;
145
148
  }
146
149
  if (defaultSortField && !((_b = this.options) == null ? void 0 : _b.group)) {
147
- if (!sort.includes(defaultSortField)) {
148
- sort.push(defaultSortField);
150
+ defaultSortField = import_lodash.default.castArray(defaultSortField);
151
+ for (const key of defaultSortField) {
152
+ if (!sort.includes(key)) {
153
+ sort.push(key);
154
+ }
149
155
  }
150
156
  }
151
157
  const orderParams = [];
@@ -46,7 +46,11 @@ const _QueryInterface = class _QueryInterface {
46
46
  } else {
47
47
  removeSql = `DROP VIEW IF EXISTS ${view.name}`;
48
48
  }
49
- await this.db.sequelize.query(removeSql, { transaction: options.transaction });
49
+ try {
50
+ await this.db.sequelize.query(removeSql, { transaction: options.transaction });
51
+ } catch (e) {
52
+ console.log(`can not drop view ${view.name}, ${e.message}`);
53
+ }
50
54
  }
51
55
  await this.db.sequelize.getQueryInterface().dropAllTables(options);
52
56
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "1.4.0-alpha.20241008122235",
3
+ "version": "1.4.0-alpha.20241016035453",
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.4.0-alpha.20241008122235",
10
- "@nocobase/utils": "1.4.0-alpha.20241008122235",
9
+ "@nocobase/logger": "1.4.0-alpha.20241016035453",
10
+ "@nocobase/utils": "1.4.0-alpha.20241016035453",
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": "5fc28661220e610f3d6dd6868190120db08bdb50"
41
+ "gitHead": "250828f40ff03e942aff5afaa45b21d2f94703ee"
42
42
  }