fix(theme-editor): remove db.sync

This commit is contained in:
chenos 2023-07-20 10:34:09 +08:00
parent 4e979bc7b7
commit fa2de8e806

View File

@ -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) {}