@nocobase/plugin-data-source-main 1.6.0-alpha.19 → 1.6.0-alpha.20
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,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.6.0-alpha.
|
|
12
|
-
"@nocobase/database": "1.6.0-alpha.
|
|
13
|
-
"@nocobase/plugin-error-handler": "1.6.0-alpha.
|
|
14
|
-
"@nocobase/server": "1.6.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.6.0-alpha.20",
|
|
12
|
+
"@nocobase/database": "1.6.0-alpha.20",
|
|
13
|
+
"@nocobase/plugin-error-handler": "1.6.0-alpha.20",
|
|
14
|
+
"@nocobase/server": "1.6.0-alpha.20",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
|
-
"@nocobase/test": "1.6.0-alpha.
|
|
17
|
-
"@nocobase/utils": "1.6.0-alpha.
|
|
16
|
+
"@nocobase/test": "1.6.0-alpha.20",
|
|
17
|
+
"@nocobase/utils": "1.6.0-alpha.20",
|
|
18
18
|
"sequelize": "6.35.2",
|
|
19
19
|
"dayjs": "1.11.10"
|
|
20
20
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Migration } from '@nocobase/server';
|
|
10
|
+
export default class extends Migration {
|
|
11
|
+
on: string;
|
|
12
|
+
up(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var remove_schema_options_exports = {};
|
|
28
|
+
__export(remove_schema_options_exports, {
|
|
29
|
+
default: () => remove_schema_options_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(remove_schema_options_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
/* istanbul ignore file -- @preserve */
|
|
34
|
+
class remove_schema_options_default extends import_server.Migration {
|
|
35
|
+
on = "afterLoad";
|
|
36
|
+
async up() {
|
|
37
|
+
const CollectionRepository = this.context.db.getRepository("collections");
|
|
38
|
+
const collections = await CollectionRepository.find({
|
|
39
|
+
filter: {
|
|
40
|
+
"options.from": "db2cm"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
for (const collection of collections) {
|
|
44
|
+
const collectionSchema = collection.get("schema");
|
|
45
|
+
const dbSchema = this.context.db.options.schema || "public";
|
|
46
|
+
if (collectionSchema && collectionSchema == dbSchema) {
|
|
47
|
+
collection.set("schema", void 0);
|
|
48
|
+
await collection.save();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -153,9 +153,13 @@ class CollectionRepository extends import_database.Repository {
|
|
|
153
153
|
...field.options
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
+
const collectionOptions = options;
|
|
157
|
+
if (collectionOptions.schema && collectionOptions.schema == (this.database.options.schema || "public")) {
|
|
158
|
+
delete collectionOptions.schema;
|
|
159
|
+
}
|
|
156
160
|
await this.create({
|
|
157
161
|
values: {
|
|
158
|
-
...
|
|
162
|
+
...collectionOptions,
|
|
159
163
|
fields,
|
|
160
164
|
from: "db2cm"
|
|
161
165
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "数据源:主数据库",
|
|
5
5
|
"description": "NocoBase main database, supports relational databases such as PostgreSQL, MySQL, MariaDB and so on.",
|
|
6
6
|
"description.zh-CN": "NocoBase 主数据库,支持 PostgreSQL、MySQL、MariaDB 等关系型数据库。",
|
|
7
|
-
"version": "1.6.0-alpha.
|
|
7
|
+
"version": "1.6.0-alpha.20",
|
|
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": "c127664eb2b900edd5c18c9344046cd663a06c3b",
|
|
26
26
|
"keywords": [
|
|
27
27
|
"Data sources"
|
|
28
28
|
]
|