From 1985ffdbe9adfe40b945a3e46ce704d39799dfbc Mon Sep 17 00:00:00 2001
From: Alexis <35.alexis.pele@gmail.com>
Date: Sat, 24 Aug 2024 22:34:51 +0200
Subject: [PATCH] Added realtime subcription to calendar page
---
pages/i/world/[id].vue | 59 ++++++++++++++++++++++++++++-
supabase/migrations/202401_init.sql | 3 ++
2 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/pages/i/world/[id].vue b/pages/i/world/[id].vue
index 0119727..3e228fe 100644
--- a/pages/i/world/[id].vue
+++ b/pages/i/world/[id].vue
@@ -1,13 +1,16 @@
diff --git a/supabase/migrations/202401_init.sql b/supabase/migrations/202401_init.sql
index dcdfcad..746cf05 100644
--- a/supabase/migrations/202401_init.sql
+++ b/supabase/migrations/202401_init.sql
@@ -160,6 +160,9 @@ alter table public.calendar_events enable row level security;
alter table public.calendar_event_categories enable row level security;
alter table public.calendar_event_categories_links enable row level security;
+-- Add realtime
+alter publication supabase_realtime add table calendars;
+
-- User policies
create policy "Allow logged-in read access" on public.users for select using ( auth.role() = 'authenticated' );
create policy "Allow individual insert access" on public.users for insert with check ( auth.uid() = id );