From 0a24db2b4e2477a8f7fade9e8f3f6598eb33abe9 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 30 Oct 2023 13:55:15 +0100 Subject: [PATCH] fix: column renaming errors --- cli/src/commands/schema/edit.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/commands/schema/edit.ts b/cli/src/commands/schema/edit.ts index ff142ef90..4fc20fe88 100644 --- a/cli/src/commands/schema/edit.ts +++ b/cli/src/commands/schema/edit.ts @@ -406,7 +406,7 @@ vectorDimension: \${vectorDimension} name: column?.name || '', type: column?.type || '', link: isColumnAdded ? '' : column?.link?.table, - vectorDimension: column?.vector?.dimension ? `${column?.vector?.dimension}` : '', + vectorDimension: column?.vector?.dimension ? `${column?.vector?.dimension}` : undefined, notNull: column?.notNull ? 'true' : 'false', defaultValue: column?.defaultValue || '', unique: column?.unique ? 'true' : 'false', @@ -863,7 +863,7 @@ function parseDefaultValue(type: string, val?: string): string | undefined { const num = String(val).length > 0 ? +val : undefined; if (['text', 'string'].includes(type)) { - return String(val); + return val === '' ? undefined : String(val); } else if (type === 'int') { return Number.isSafeInteger(num) && val !== '' ? String(num) : undefined; } else if (type === 'float') {