From fc7d2ab7f06a32f44951bccbbe657cb93ade41de Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 10 Mar 2025 12:57:58 +0100 Subject: [PATCH] Table editor fix is extra options state for PK columns (#34099) --- .../SidePanelEditor/TableEditor/Column.tsx | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx index 9328642dc5..2730d3e11a 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx @@ -12,7 +12,6 @@ import { PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_, - Separator, cn, } from 'ui' @@ -268,7 +267,13 @@ const Column = ({ onUpdateColumn({ isPrimaryKey: !column.isPrimaryKey })} + onChange={() => { + const updatedValue = !column.isPrimaryKey + onUpdateColumn({ + isPrimaryKey: updatedValue, + isNullable: updatedValue ? false : column.isNullable, + }) + }} />
@@ -295,16 +300,13 @@ const Column = ({
{!column.isPrimaryKey && ( - <> - onUpdateColumn({ isNullable: !column.isNullable })} - /> - - + onUpdateColumn({ isNullable: !column.isNullable })} + /> )} onUpdateColumn({ isUnique: !column.isUnique })} /> - {column.format.includes('int') && (