From d871554bf1dce23543b4a9e4fa3790c83bae8d9e Mon Sep 17 00:00:00 2001 From: Rain <958414905@qq.com> Date: Mon, 30 Oct 2023 11:26:39 +0800 Subject: [PATCH] fix(theme-editor): should add uid field in migration --- .../src/server/migrations/202307250851-theme-editor.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@nocobase/plugin-theme-editor/src/server/migrations/202307250851-theme-editor.ts b/packages/plugins/@nocobase/plugin-theme-editor/src/server/migrations/202307250851-theme-editor.ts index 0b51f4183..3ca54b9ca 100644 --- a/packages/plugins/@nocobase/plugin-theme-editor/src/server/migrations/202307250851-theme-editor.ts +++ b/packages/plugins/@nocobase/plugin-theme-editor/src/server/migrations/202307250851-theme-editor.ts @@ -16,7 +16,13 @@ export default class ThemeEditorMigration extends Migration { return; } - this.db.getCollection('themeConfig').sync(); + const collection = this.db.getCollection('themeConfig'); + if (!collection.hasField('uid')) { + collection.addField('uid', { + type: 'uid', + }); + } + collection.sync(); const themes = { [defaultTheme.uid]: defaultTheme,