From 476d0b869c46ffe14c4f3b690ea025a5d6a68c07 Mon Sep 17 00:00:00 2001 From: Chareice Date: Wed, 24 Jan 2024 18:19:37 +0800 Subject: [PATCH] chore: restore file --- .../collections/database-connections.ts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/plugins/@nocobase/plugin-data-source-manager/src/server/collections/database-connections.ts diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/server/collections/database-connections.ts b/packages/plugins/@nocobase/plugin-data-source-manager/src/server/collections/database-connections.ts new file mode 100644 index 0000000000..8c82777c26 --- /dev/null +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/server/collections/database-connections.ts @@ -0,0 +1,35 @@ +import { defineCollection } from '@nocobase/database'; + +export default defineCollection({ + name: 'databaseConnections', + duplicator: 'required', + model: 'DatabaseConnectionModel', + autoGenId: false, + fields: [ + { + type: 'string', + name: 'name', + primaryKey: true, + }, + { + type: 'string', + name: 'description', + }, + { + type: 'json', + name: 'options', + }, + { + type: 'hasMany', + name: 'collections', + target: 'remoteCollections', + foreignKey: 'connectionName', + }, + { + type: 'hasMany', + name: 'connectionsRolesResourcesScopes', + target: 'connectionsRolesResourcesScopes', + foreignKey: 'connectionName', + }, + ], +});