Skip to content

Commit

Permalink
fix: column renaming errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eemmiillyy committed Oct 30, 2023
1 parent 48cb976 commit 0a24db2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/src/commands/schema/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit 0a24db2

Please sign in to comment.