fix: normalize temporal column precision

This commit is contained in:
t8y2
2026-05-26 14:38:53 +08:00
parent 8539e492cc
commit 32a4a5b1ec
4 changed files with 185 additions and 17 deletions
@@ -38,7 +38,7 @@ import { type EditableStructureColumn, type EditableStructureIndex } from "@/lib
import { getTableStructureCapabilities } from "@/lib/tableStructureCapabilities";
import {
buildStructureTargetLabel,
combineDataType,
combineDataTypeForDatabase,
createColumnDrafts,
createIndexDrafts,
DATA_TYPE_OPTIONS,
@@ -545,7 +545,12 @@ watch(
:allow-custom="true"
trigger-class="h-6 w-full font-mono text-[11px]"
@update:model-value="
(v: string) => (column.dataType = combineDataType(v, splitDataType(column.dataType).params))
(v: string) =>
(column.dataType = combineDataTypeForDatabase(
databaseType,
v,
splitDataType(column.dataType).params,
))
"
/>
<Input
@@ -561,7 +566,11 @@ watch(
class="h-6 min-w-16 font-mono text-[11px]"
:disabled="isColumnTypeDisabled(column)"
@update:model-value="
column.dataType = combineDataType(splitDataType(column.dataType).baseType, String($event))
column.dataType = combineDataTypeForDatabase(
databaseType,
splitDataType(column.dataType).baseType,
String($event),
)
"
/>
</td>