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', + }, + ], +});