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

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,6 +140,9 @@ 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) && this.collection.filterTargetKey.length == 1) {
144
+ defaultSortField = this.collection.filterTargetKey[0];
145
+ }
143
146
  if (!defaultSortField && this.collection.filterTargetKey && !Array.isArray(this.collection.filterTargetKey)) {
144
147
  defaultSortField = this.collection.filterTargetKey;
145
148
  }
@@ -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.20241011073807",
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.20241011073807",
10
+ "@nocobase/utils": "1.4.0-alpha.20241011073807",
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": "f2d5dd5ede95fbb62e426e843e0f1782306750f2"
42
42
  }