From f2ad713049e071b46e13636adc4b2eb41aacd231 Mon Sep 17 00:00:00 2001 From: Sean Oliver <882952+seanoliver@users.noreply.github.com> Date: Fri, 19 Sep 2025 11:57:48 -0700 Subject: [PATCH] feat: add third template option to Analytics category - Add 'metrics' table template for custom KPI tracking - Ensures all template categories have exactly 3 options --- .../TableEditor/TableQuickstart/templates.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableQuickstart/templates.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableQuickstart/templates.ts index 4c7f242c5e7..7cd2adfbbd3 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableQuickstart/templates.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableQuickstart/templates.ts @@ -173,5 +173,19 @@ export const tableTemplates: Record = { rationale: 'Page view tracking', source: 'template' as const, }, + { + tableName: 'metrics', + fields: [ + { name: 'id', type: 'uuid', nullable: false, isPrimary: true, default: 'gen_random_uuid()' }, + { name: 'metric_name', type: 'varchar', nullable: false }, + { name: 'value', type: 'numeric', nullable: false }, + { name: 'tags', type: 'jsonb', nullable: true }, + { name: 'timestamp', type: 'timestamptz', nullable: false, default: 'now()' }, + { name: 'aggregation_period', type: 'varchar', nullable: true }, + { name: 'created_at', type: 'timestamptz', nullable: false, default: 'now()' }, + ], + rationale: 'Custom metrics and KPI tracking', + source: 'template' as const, + }, ], } \ No newline at end of file