-- Enable RLS on the archive table ALTER TABLE public.entity_versions_archive ENABLE ROW LEVEL SECURITY; -- Create RLS policies for the archive table (same as original) CREATE POLICY "Moderators can view all archived versions" ON public.entity_versions_archive FOR SELECT TO authenticated USING (is_moderator(auth.uid())); CREATE POLICY "Public can view current archived versions" ON public.entity_versions_archive FOR SELECT TO authenticated USING (is_current = true);