From fda22a8148eb406d66dc083e07546d22727c4c12 Mon Sep 17 00:00:00 2001 From: hanzlamateen Date: Mon, 10 Jun 2024 18:22:24 +0500 Subject: [PATCH] Fixed migration --- .../migrations/20240606125000_migrate-project-settings.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server-core/src/projects/project/migrations/20240606125000_migrate-project-settings.ts b/packages/server-core/src/projects/project/migrations/20240606125000_migrate-project-settings.ts index 12dd6832a7..870f8f51b9 100644 --- a/packages/server-core/src/projects/project/migrations/20240606125000_migrate-project-settings.ts +++ b/packages/server-core/src/projects/project/migrations/20240606125000_migrate-project-settings.ts @@ -85,7 +85,9 @@ export async function up(knex: Knex): Promise { if (projects.length > 0) { const projectSettings = await getConvertedProjectSettings(projects.filter((item) => item.settings)) - await knex.from(projectSettingPath).insert(projectSettings) + if (projectSettings.length > 0) { + await knex.from(projectSettingPath).insert(projectSettings) + } } await knex.schema.alterTable(projectPath, async (table) => {