From fa2de8e8060da00a85b381df0d7fbf9fca2793b3 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 20 Jul 2023 10:34:09 +0800 Subject: [PATCH] fix(theme-editor): remove db.sync --- .../plugins/theme-editor/src/server/plugin.ts | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/packages/plugins/theme-editor/src/server/plugin.ts b/packages/plugins/theme-editor/src/server/plugin.ts index 0e7f2c1e36..2ed0d2a19a 100644 --- a/packages/plugins/theme-editor/src/server/plugin.ts +++ b/packages/plugins/theme-editor/src/server/plugin.ts @@ -1,4 +1,3 @@ -import { defineCollection } from '@nocobase/database'; import { InstallOptions, Plugin } from '@nocobase/server'; export class ThemeEditorPlugin extends Plugin { @@ -7,29 +6,25 @@ export class ThemeEditorPlugin extends Plugin { beforeLoad() {} async load() { - this.db.collection( - defineCollection({ - name: 'themeConfig', - fields: [ - // 主题配置内容,一个 JSON 字符串 - { - type: 'json', - name: 'config', - }, - // 主题是否可选 - { - type: 'boolean', - name: 'optional', - }, - { - type: 'boolean', - name: 'isBuiltIn', - }, - ], - }), - ); - - await this.db.sync(); + this.db.collection({ + name: 'themeConfig', + fields: [ + // 主题配置内容,一个 JSON 字符串 + { + type: 'json', + name: 'config', + }, + // 主题是否可选 + { + type: 'boolean', + name: 'optional', + }, + { + type: 'boolean', + name: 'isBuiltIn', + }, + ], + }); } async install(options?: InstallOptions) {}