jskim-node #419

Merged
kjs merged 15 commits from jskim-node into main 2026-03-17 09:56:34 +09:00
2 changed files with 10 additions and 2 deletions
Showing only changes of commit 6a50e1e924 - Show all commits

View File

@ -1592,6 +1592,10 @@ export default function TableManagementPage() {
constraints={constraints}
typeFilter={typeFilter}
getColumnIndexState={getColumnIndexState}
onPkToggle={handlePkToggle}
onIndexToggle={(columnName, checked) =>
handleIndexToggle(columnName, "index", checked)
}
/>
</>
)}

View File

@ -21,6 +21,8 @@ export interface ColumnGridProps {
constraints: ColumnGridConstraints;
typeFilter?: string | null;
getColumnIndexState?: (columnName: string) => { isPk: boolean; hasIndex: boolean };
onPkToggle?: (columnName: string, checked: boolean) => void;
onIndexToggle?: (columnName: string, checked: boolean) => void;
}
function getIndexState(
@ -49,6 +51,8 @@ export function ColumnGrid({
constraints,
typeFilter = null,
getColumnIndexState: externalGetIndexState,
onPkToggle,
onIndexToggle,
}: ColumnGridProps) {
const getIdxState = useMemo(
() => externalGetIndexState ?? ((name: string) => getIndexState(name, constraints)),
@ -193,7 +197,7 @@ export function ColumnGrid({
)}
onClick={(e) => {
e.stopPropagation();
onColumnChange(column.columnName, "isPrimaryKey" as keyof ColumnTypeInfo, !idxState.isPk);
onPkToggle?.(column.columnName, !idxState.isPk);
}}
title="Primary Key 토글"
>
@ -225,7 +229,7 @@ export function ColumnGrid({
)}
onClick={(e) => {
e.stopPropagation();
onColumnChange(column.columnName, "hasIndex" as keyof ColumnTypeInfo, !idxState.hasIndex);
onIndexToggle?.(column.columnName, !idxState.hasIndex);
}}
title="Index 토글"
>