Skip to content

Commit c4e5abf

Browse files
waleedlatif1claude
andcommitted
fix(tables): capture columnRequired in delete-column undo for full restoration
The delete-column undo action captured columnUnique but not columnRequired, so undoing a delete on a required column would silently drop the constraint. Now captures and restores both constraints. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d132985 commit c4e5abf

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table/table.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,7 @@ export function Table({
17551755
columnType: colDef?.type ?? 'string',
17561756
columnPosition: colPosition >= 0 ? colPosition : cols.length,
17571757
columnUnique: colDef?.unique ?? false,
1758+
columnRequired: colDef?.required ?? false,
17581759
cellData,
17591760
previousOrder: orderAtDelete ? [...orderAtDelete] : null,
17601761
previousWidth,

apps/sim/hooks/use-table-undo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export function useTableUndo({
215215
{
216216
name: action.columnName,
217217
type: action.columnType,
218+
required: action.columnRequired,
218219
unique: action.columnUnique,
219220
position: action.columnPosition,
220221
},

apps/sim/stores/table/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export type TableUndoAction =
3838
columnType: string
3939
columnPosition: number
4040
columnUnique: boolean
41+
columnRequired: boolean
4142
cellData: Array<{ rowId: string; value: unknown }>
4243
previousOrder: string[] | null
4344
previousWidth: number | null

0 commit comments

Comments
 (0)