Files
SteelXR2/supabase/migrations/20260514124951_23703083-0333-44bc-bb04-a2eef2d65bb8.sql
T
gpt-engineer-app[bot] 8c48abf36a Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
2026-05-14 12:49:54 +00:00

21 lines
643 B
SQL

create table public.share_rooms (
code text primary key,
created_at timestamptz not null default now(),
expires_at timestamptz not null default (now() + interval '4 hours'),
is_active boolean not null default true,
viewer_count int not null default 0
);
alter table public.share_rooms enable row level security;
create policy "anyone can read active rooms"
on public.share_rooms for select
using (is_active = true and expires_at > now());
create policy "anyone can create rooms"
on public.share_rooms for insert
with check (true);
create policy "anyone can update rooms"
on public.share_rooms for update
using (true);