Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Remove varchar, json, timetz and timestamp from being able to be selected when creating column in table editor

Joshen Lim1d1cabda36d8
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.constants.ts b/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.constants.ts
index 8bbcbcd8750..93d1de22237 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.constants.ts
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.constants.ts
@@ -3,12 +3,12 @@ import { PostgresDataTypeOption } from './SidePanelEditor.types'
export const DATE_FORMAT = 'YYYY-MM-DDTHH:mm:ssZ'
export const NUMERICAL_TYPES = ['int2', 'int4', 'int8', 'float4', 'float8', 'numeric']
-export const JSON_TYPES = ['jsonb']
-export const TEXT_TYPES = ['text']
+export const JSON_TYPES = ['json', 'jsonb']
+export const TEXT_TYPES = ['text', 'varchar']
-export const TIMESTAMP_TYPES = ['timestamptz']
+export const TIMESTAMP_TYPES = ['timestamp', 'timestamptz']
export const DATE_TYPES = ['date']
-export const TIME_TYPES = ['time']
+export const TIME_TYPES = ['time', 'timetz']
export const DATETIME_TYPES = concat(TIMESTAMP_TYPES, DATE_TYPES, TIME_TYPES)
export const OTHER_DATA_TYPES = ['uuid', 'bool']
@@ -47,11 +47,6 @@ export const POSTGRES_DATA_TYPE_OPTIONS: PostgresDataTypeOption[] = [
description: 'Exact numeric of selectable precision',
type: 'number',
},
- {
- name: 'json',
- description: 'Textual JSON data',
- type: 'json',
- },
{
name: 'jsonb',
description: 'Binary JSON data, decomposed',
@@ -62,11 +57,6 @@ export const POSTGRES_DATA_TYPE_OPTIONS: PostgresDataTypeOption[] = [
description: 'Variable-length character string',
type: 'text',
},
- {
- name: 'varchar',
- description: 'Variable-length character string',
- type: 'text',
- },
{
name: 'uuid',
description: 'Universally unique identifier',
@@ -82,16 +72,6 @@ export const POSTGRES_DATA_TYPE_OPTIONS: PostgresDataTypeOption[] = [
description: 'Time of day (no time zone)',
type: 'time',
},
- {
- name: 'timetz',
- description: 'Time of day, including time zone',
- type: 'time',
- },
- {
- name: 'timestamp',
- description: 'Date and time (no time zone)',
- type: 'time',
- },
{
name: 'timestamptz',
description: 'Date and time, including time zone',