@nocobase/plugin-data-source-main 2.1.0-beta.26 → 2.1.0-beta.27
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,16 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.27",
|
|
12
12
|
"lodash": "4.18.1",
|
|
13
|
-
"@nocobase/ai": "2.1.0-beta.
|
|
14
|
-
"@nocobase/database": "2.1.0-beta.
|
|
15
|
-
"@nocobase/plugin-error-handler": "2.1.0-beta.
|
|
16
|
-
"@nocobase/server": "2.1.0-beta.
|
|
13
|
+
"@nocobase/ai": "2.1.0-beta.27",
|
|
14
|
+
"@nocobase/database": "2.1.0-beta.27",
|
|
15
|
+
"@nocobase/plugin-error-handler": "2.1.0-beta.27",
|
|
16
|
+
"@nocobase/server": "2.1.0-beta.27",
|
|
17
17
|
"sequelize": "6.35.2",
|
|
18
18
|
"@formily/json-schema": "2.3.7",
|
|
19
|
-
"@nocobase/test": "2.1.0-beta.
|
|
20
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
21
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
19
|
+
"@nocobase/test": "2.1.0-beta.27",
|
|
20
|
+
"@nocobase/utils": "2.1.0-beta.27",
|
|
21
|
+
"@nocobase/actions": "2.1.0-beta.27",
|
|
22
22
|
"dayjs": "1.11.13"
|
|
23
23
|
};
|
|
@@ -41,6 +41,7 @@ __export(collection_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(collection_exports);
|
|
42
42
|
var import_database = require("@nocobase/database");
|
|
43
43
|
var import_lodash = __toESM(require("lodash"));
|
|
44
|
+
const databaseSyncedCollectionSources = ["db2cm", "dbsync"];
|
|
44
45
|
class CollectionModel extends import_database.MagicAttributeModel {
|
|
45
46
|
get db() {
|
|
46
47
|
return this.constructor.database;
|
|
@@ -72,7 +73,7 @@ class CollectionModel extends import_database.MagicAttributeModel {
|
|
|
72
73
|
if (!this.db.inDialect("postgres") && collectionOptions.schema) {
|
|
73
74
|
delete collectionOptions.schema;
|
|
74
75
|
}
|
|
75
|
-
if (this.db.inDialect("postgres") && !collectionOptions.schema && collectionOptions.from
|
|
76
|
+
if (this.db.inDialect("postgres") && !collectionOptions.schema && !databaseSyncedCollectionSources.includes(collectionOptions.from)) {
|
|
76
77
|
collectionOptions.schema = process.env.COLLECTION_MANAGER_SCHEMA || this.db.options.schema || "public";
|
|
77
78
|
}
|
|
78
79
|
if (this.db.hasCollection(name)) {
|
package/dist/server/server.js
CHANGED
|
@@ -110,7 +110,7 @@ class PluginDataSourceMainServer extends import_server.Plugin {
|
|
|
110
110
|
});
|
|
111
111
|
this.app.db.on("collections.beforeCreate", (0, import_beforeCreateForViewCollection.beforeCreateForViewCollection)(this.db));
|
|
112
112
|
this.app.db.on("collections.beforeCreate", async (model, options) => {
|
|
113
|
-
if (this.app.db.getCollection(model.get("name")) && model.get("from")
|
|
113
|
+
if (this.app.db.getCollection(model.get("name")) && !["db2cm", "dbsync"].includes(model.get("from")) && !model.get("isThrough")) {
|
|
114
114
|
throw new Error(`Collection named ${model.get("name")} already exists`);
|
|
115
115
|
}
|
|
116
116
|
});
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "NocoBase main database, supports relational databases such as PostgreSQL, MySQL, MariaDB and so on.",
|
|
7
7
|
"description.ru-RU": "Основная база данных NocoBase: поддерживает реляционные СУБД, включая PostgreSQL, MySQL, MariaDB и другие.",
|
|
8
8
|
"description.zh-CN": "NocoBase 主数据库,支持 PostgreSQL、MySQL、MariaDB 等关系型数据库。",
|
|
9
|
-
"version": "2.1.0-beta.
|
|
9
|
+
"version": "2.1.0-beta.27",
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
11
|
"homepage": "https://docs.nocobase.com/handbook/data-source-main",
|
|
12
12
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/data-source-main",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@nocobase/test": "2.x",
|
|
26
26
|
"@nocobase/utils": "2.x"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "6d9e2d4ac3c6bf40951c8eb252860e47aa3a3c37",
|
|
29
29
|
"keywords": [
|
|
30
30
|
"Data sources"
|
|
31
31
|
]
|