From fce2f9a46a85cbed781946cc1e33656a7ef58208 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 16 Sep 2021 13:56:53 +0200 Subject: [PATCH] fix --- packages/tools/src/schemaEditorTools.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/tools/src/schemaEditorTools.ts b/packages/tools/src/schemaEditorTools.ts index a73a12f7b..c67c3d2d6 100644 --- a/packages/tools/src/schemaEditorTools.ts +++ b/packages/tools/src/schemaEditorTools.ts @@ -9,6 +9,7 @@ import { TableInfo, UniqueInfo, } from 'dbgate-types'; +import _ from 'lodash'; export interface EditorColumnInfo extends ColumnInfo { isPrimaryKey?: boolean; @@ -17,7 +18,7 @@ export interface EditorColumnInfo extends ColumnInfo { export function fillEditorColumnInfo(column: ColumnInfo, table: TableInfo): EditorColumnInfo { return { isPrimaryKey: !!table?.primaryKey?.columns?.find(x => x.columnName == column.columnName), - dataType: column ? undefined : 'int', + dataType: _.isEmpty(column) ? 'int' : undefined, ...column, }; }