From 38d300bd35d50bf6b10bd86e217adac284e9c4fa Mon Sep 17 00:00:00 2001 From: zipg Date: Sun, 28 Jun 2026 09:59:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(mysql):=20=E4=BF=AE=E5=A4=8D=20enum/set=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E9=95=BF=E5=BA=A6=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/editor/EditorSettingsDialog.vue | 4 ++-- .../components/structure/TableStructureEditor.vue | 8 +++++++- .../__tests__/tableStructureEditorState.spec.ts | 15 ++++++++++++++- apps/desktop/src/lib/tableStructureEditorState.ts | 7 +++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 3ef20272f4..a85906ecb7 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -67,7 +67,7 @@ import { normalizeSidebarHiddenTablePrefixes } from "@/lib/sidebarTableNameDispl import { normalizeSqlFormatterSettings, type SqlFormatterSettings } from "@/lib/sqlFormatterConfig"; import { EMPTY_TABLE_COLUMN_TEMPLATE_DATA_TYPE, parseTableColumnTemplateFields, TABLE_COLUMN_TEMPLATE_DATABASE_TYPES } from "@/lib/tableColumnTemplates"; import { buildMcpCodexConfig, buildMcpJsonConfig, buildMcpOpenCodeConfig, buildMcpVsCodeConfig, type McpEnvEntry } from "@/lib/mcpConfigTemplates"; -import { combineDataTypeForDatabase, getDataTypeOptions, getDefaultLengthForType, isDataTypeLengthDisabled, splitDataType } from "@/lib/tableStructureEditorState"; +import { combineDataTypeForDatabase, dataTypeLengthInputValue, getDataTypeOptions, getDefaultLengthForType, isDataTypeLengthDisabled, splitDataType } from "@/lib/tableStructureEditorState"; import type { DatabaseType, SqlSnippet } from "@/types/database"; import { uuid } from "@/lib/utils"; import { DEFAULT_SQL_SNIPPETS } from "@/lib/sqlCompletion"; @@ -815,7 +815,7 @@ function tableColumnTemplateBaseTypeForSelectedDatabase(row: TableColumnTemplate } function tableColumnTemplateLengthForSelectedDatabase(row: TableColumnTemplateGridRow): string { - return splitDataType(tableColumnTemplateDataTypeForSelectedDatabase(row)).params; + return dataTypeLengthInputValue(editTableColumnTemplateDatabaseType.value, tableColumnTemplateDataTypeForSelectedDatabase(row)); } function setTableColumnTemplateDataTypeForSelectedDatabase(row: TableColumnTemplateGridRow, value: string) { diff --git a/apps/desktop/src/components/structure/TableStructureEditor.vue b/apps/desktop/src/components/structure/TableStructureEditor.vue index 089bac6665..e025b6120f 100644 --- a/apps/desktop/src/components/structure/TableStructureEditor.vue +++ b/apps/desktop/src/components/structure/TableStructureEditor.vue @@ -34,6 +34,7 @@ import { createForeignKeyDrafts, createIndexDrafts, createTriggerDrafts, + dataTypeLengthInputValue, generateIndexName, generateUniqueIndexName, getColumnEditorControls, @@ -1506,7 +1507,12 @@ watch(activeTab, (tab) => { - +