The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix(studio): custom schema enum column creation (#31150)
Andrew Valleteaue212aa1de966
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsxindex 11a48a2ba85..5966e72f5c0 100644--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx@@ -68,7 +68,7 @@ const ColumnType = ({}: ColumnTypeProps) => {const [open, setOpen] = useState(false)// @ts-ignore- const availableTypes = POSTGRES_DATA_TYPES.concat(enumTypes.map((type) => type.name))+ const availableTypes = POSTGRES_DATA_TYPES.concat(enumTypes.map((type) => type.format))const isAvailableType = value ? availableTypes.includes(value) : trueconst recommendation = RECOMMENDED_ALTERNATIVE_DATA_TYPE[value]@@ -78,7 +78,7 @@ const ColumnType = ({if (pgOption) return pgOption// handle custom enums- const enumType = enumTypes.find((type) => type.name === name)+ const enumType = enumTypes.find((type) => type.format === name)return enumType ? { ...enumType, type: 'enum' } : undefined}@@ -244,11 +244,14 @@ const ColumnType = ({<><CommandItem_Shadcn_>Other types</CommandItem_Shadcn_><CommandGroup_Shadcn_>- {enumTypes.map((option: any) => (+ {enumTypes.map((option) => (<CommandItem_Shadcn_- key={option.name}- value={option.name}- className={cn('relative', option.name === value ? 'bg-surface-200' : '')}+ key={option.format}+ value={option.format}+ className={cn(+ 'relative',+ option.format === value ? 'bg-surface-200' : ''+ )}onSelect={(value: string) => {onOptionSelect(value)setOpen(false)@@ -258,14 +261,17 @@ const ColumnType = ({<div><ListPlus size={16} className="text-foreground" strokeWidth={1.5} /></div>- <span className="text-foreground">{option.name}</span>+ <span className="text-foreground">{option.format}</span>{option.comment !== undefined && (- <span title={option.comment} className="text-foreground-lighter">+ <span+ title={option.comment ?? ''}+ className="text-foreground-lighter"+ >{option.comment}</span>)}<span className="flex items-center gap-1.5">- {option.name === value ? <Check size={13} /> : ''}+ {option.format === value ? <Check size={13} /> : ''}</span></div></CommandItem_Shadcn_>