feat(structure): auto-switch column length default based on data type

When changing a column's data type in the table structure editor, the
length parameter now updates to a sensible default for the new type
(e.g. int→11, tinyint→4) instead of preserving the old value.
This commit is contained in:
t8y2 committed 2026-05-28 21:36:28 +08:00
1 parent c943bf4179
commit 9aae48d089
2 files changed
+37 -1

No files matched your search

@@ -42,6 +42,7 @@ import {
createColumnDrafts,
createIndexDrafts,
DATA_TYPE_OPTIONS,
getDefaultLengthForType,
splitDataType,
toColumnNames,
} from "@/lib/tableStructureEditorState";
@@ -574,7 +575,7 @@ watch(
(column.dataType = combineDataTypeForDatabase(
databaseType,
v,
splitDataType(column.dataType).params,
getDefaultLengthForType(databaseType, v),
))
"
/>