@nocobase/plugin-data-source-main 1.2.34-alpha → 1.2.36-alpha
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/dist/externalVersion.js
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.2.
|
|
12
|
-
"@nocobase/database": "1.2.
|
|
13
|
-
"@nocobase/plugin-error-handler": "1.2.
|
|
14
|
-
"@nocobase/server": "1.2.
|
|
11
|
+
"@nocobase/client": "1.2.36-alpha",
|
|
12
|
+
"@nocobase/database": "1.2.36-alpha",
|
|
13
|
+
"@nocobase/plugin-error-handler": "1.2.36-alpha",
|
|
14
|
+
"@nocobase/server": "1.2.36-alpha",
|
|
15
15
|
"async-mutex": "0.3.2",
|
|
16
16
|
"lodash": "4.17.21",
|
|
17
|
-
"@nocobase/test": "1.2.
|
|
18
|
-
"@nocobase/utils": "1.2.
|
|
17
|
+
"@nocobase/test": "1.2.36-alpha",
|
|
18
|
+
"@nocobase/utils": "1.2.36-alpha",
|
|
19
19
|
"sequelize": "6.35.2",
|
|
20
20
|
"dayjs": "1.11.10"
|
|
21
21
|
};
|
|
@@ -141,8 +141,7 @@ function afterCreateForForeignKeyField(db) {
|
|
|
141
141
|
otherKey,
|
|
142
142
|
source
|
|
143
143
|
} = model.get();
|
|
144
|
-
if (source)
|
|
145
|
-
return;
|
|
144
|
+
if (source) return;
|
|
146
145
|
if (["oho", "o2m"].includes(interfaceType)) {
|
|
147
146
|
const values = generateFkOptions(target, foreignKey);
|
|
148
147
|
await createFieldIfNotExists({
|
|
@@ -153,14 +153,12 @@ class FieldModel extends import_database.MagicAttributeModel {
|
|
|
153
153
|
}
|
|
154
154
|
async syncReferenceCheckOption(options) {
|
|
155
155
|
const reverseKey = this.get("reverseKey");
|
|
156
|
-
if (!reverseKey)
|
|
157
|
-
return;
|
|
156
|
+
if (!reverseKey) return;
|
|
158
157
|
const reverseField = await this.db.getCollection("fields").repository.findOne({
|
|
159
158
|
filterByTk: reverseKey,
|
|
160
159
|
transaction: options.transaction
|
|
161
160
|
});
|
|
162
|
-
if (!reverseField)
|
|
163
|
-
return;
|
|
161
|
+
if (!reverseField) return;
|
|
164
162
|
reverseField.set("onDelete", this.get("onDelete"));
|
|
165
163
|
await reverseField.save({ hooks: false, transaction: options.transaction });
|
|
166
164
|
}
|
|
@@ -70,8 +70,7 @@ class CollectionRepository extends import_database.Repository {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
if (graph.nodeCount() === 0)
|
|
74
|
-
return;
|
|
73
|
+
if (graph.nodeCount() === 0) return;
|
|
75
74
|
if (!graphlib.alg.isAcyclic(graph)) {
|
|
76
75
|
const cycles = graphlib.alg.findCycles(graph);
|
|
77
76
|
throw new Error(`Cyclic dependencies: ${cycles.map((cycle) => cycle.join(" -> ")).join(", ")}`);
|
|
@@ -79,8 +78,7 @@ class CollectionRepository extends import_database.Repository {
|
|
|
79
78
|
const sortedNames = graphlib.alg.topsort(graph);
|
|
80
79
|
const lazyCollectionFields = /* @__PURE__ */ new Map();
|
|
81
80
|
for (const instanceName of sortedNames) {
|
|
82
|
-
if (!nameMap[instanceName])
|
|
83
|
-
continue;
|
|
81
|
+
if (!nameMap[instanceName]) continue;
|
|
84
82
|
const skipField = (() => {
|
|
85
83
|
if (viewCollections.includes(instanceName)) {
|
|
86
84
|
return true;
|
package/dist/server/server.js
CHANGED
|
@@ -127,8 +127,7 @@ class PluginDataSourceMainServer extends import_server.Plugin {
|
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
this.app.db.on("fields.beforeCreate", async (model, options) => {
|
|
130
|
-
if (model.get("source"))
|
|
131
|
-
return;
|
|
130
|
+
if (model.get("source")) return;
|
|
132
131
|
const type = model.get("type");
|
|
133
132
|
const fn = import_hooks.beforeInitOptions[type];
|
|
134
133
|
if (fn) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "数据源:主数据库",
|
|
5
5
|
"description": "NocoBase main database, supports relational databases such as MySQL, PostgreSQL, SQLite and so on.",
|
|
6
6
|
"description.zh-CN": "NocoBase 主数据库,支持 MySQL、PostgreSQL、SQLite 等关系型数据库。",
|
|
7
|
-
"version": "1.2.
|
|
7
|
+
"version": "1.2.36-alpha",
|
|
8
8
|
"main": "./dist/server/index.js",
|
|
9
9
|
"homepage": "https://docs.nocobase.com/handbook/data-source-main",
|
|
10
10
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/data-source-main",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@nocobase/test": "1.x",
|
|
23
23
|
"@nocobase/utils": "1.x"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "850d812db1d8e7c0b62b77c6a262ab9faf9e203f",
|
|
26
26
|
"keywords": [
|
|
27
27
|
"Data sources"
|
|
28
28
|
]
|