diff --git a/.changeset/slow-waves-matter.md b/.changeset/slow-waves-matter.md new file mode 100644 index 000000000..1d2be6c71 --- /dev/null +++ b/.changeset/slow-waves-matter.md @@ -0,0 +1,5 @@ +--- +"@xata.io/cli": patch +--- + +fix: column renaming errors 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') {