@nocobase/plugin-collection-tree 1.6.8 → 1.6.10

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.
@@ -8,11 +8,11 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.6.8",
12
- "@nocobase/database": "1.6.8",
13
- "@nocobase/utils": "1.6.8",
11
+ "@nocobase/client": "1.6.10",
12
+ "@nocobase/database": "1.6.10",
13
+ "@nocobase/utils": "1.6.10",
14
14
  "lodash": "4.17.21",
15
- "@nocobase/data-source-manager": "1.6.8",
16
- "@nocobase/server": "1.6.8",
15
+ "@nocobase/data-source-manager": "1.6.10",
16
+ "@nocobase/server": "1.6.10",
17
17
  "sequelize": "6.35.2"
18
18
  };
@@ -59,6 +59,7 @@ class collection_tree_default extends import_server.Migration {
59
59
  await this.db.sequelize.transaction(async (transaction) => {
60
60
  const treeCollections = await this.getTreeCollections({ transaction });
61
61
  for (const treeCollection of treeCollections) {
62
+ await treeCollection.load({ transaction });
62
63
  const name = `main_${treeCollection.name}_path`;
63
64
  const collectionOptions = {
64
65
  name,
@@ -84,19 +85,6 @@ class collection_tree_default extends import_server.Migration {
84
85
  const treeExistsInDb = await this.app.db.getCollection(name).existsInDb({ transaction });
85
86
  if (!treeExistsInDb) {
86
87
  await this.app.db.getCollection(name).sync({ transaction });
87
- const opts = {
88
- name: treeCollection.name,
89
- autoGenId: false,
90
- timestamps: false,
91
- fields: [
92
- { type: "integer", name: "id" },
93
- { type: "integer", name: "parentId" }
94
- ]
95
- };
96
- if (treeCollectionSchema != this.app.db.options.schema) {
97
- opts["schema"] = treeCollectionSchema;
98
- }
99
- this.app.db.collection(opts);
100
88
  const chunkSize = 1e3;
101
89
  await this.app.db.getRepository(treeCollection.name).chunk({
102
90
  chunkSize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-collection-tree",
3
- "version": "1.6.8",
3
+ "version": "1.6.10",
4
4
  "displayName": "Collection: Tree",
5
5
  "displayName.zh-CN": "数据表:树",
6
6
  "description": "Provides tree collection template",
@@ -14,5 +14,5 @@
14
14
  "@nocobase/server": "1.x",
15
15
  "@nocobase/test": "1.x"
16
16
  },
17
- "gitHead": "0261bf929dde4d1feb6479c2ef7105b15754ab53"
17
+ "gitHead": "e60f706756ba6e0d11a6b9a752c02531db8500bc"
18
18
  }