Oysiyl commited on
Commit
4c0cd76
·
1 Parent(s): f252b4e

Harden Supabase analytics schema

Browse files
Files changed (1) hide show
  1. analytics_supabase_schema.sql +8 -0
analytics_supabase_schema.sql CHANGED
@@ -26,6 +26,10 @@ create index if not exists analytics_generation_events_generation_id_idx
26
  create index if not exists analytics_generation_events_source_pipeline_idx
27
  on public.analytics_generation_events (source, pipeline, timestamp desc);
28
 
 
 
 
 
29
  create table if not exists public.analytics_download_events (
30
  id uuid primary key default gen_random_uuid(),
31
  generation_id text,
@@ -48,6 +52,10 @@ create index if not exists analytics_download_events_generation_id_idx
48
  create index if not exists analytics_download_events_source_pipeline_idx
49
  on public.analytics_download_events (source, pipeline, timestamp desc);
50
 
 
 
 
 
51
  create or replace view public.analytics_generation_outcomes as
52
  select
53
  g.generation_id,
 
26
  create index if not exists analytics_generation_events_source_pipeline_idx
27
  on public.analytics_generation_events (source, pipeline, timestamp desc);
28
 
29
+ alter table public.analytics_generation_events enable row level security;
30
+
31
+ revoke all on table public.analytics_generation_events from anon, authenticated;
32
+
33
  create table if not exists public.analytics_download_events (
34
  id uuid primary key default gen_random_uuid(),
35
  generation_id text,
 
52
  create index if not exists analytics_download_events_source_pipeline_idx
53
  on public.analytics_download_events (source, pipeline, timestamp desc);
54
 
55
+ alter table public.analytics_download_events enable row level security;
56
+
57
+ revoke all on table public.analytics_download_events from anon, authenticated;
58
+
59
  create or replace view public.analytics_generation_outcomes as
60
  select
61
  g.generation_id,