-- Fix RLS policy for book_word_count_queue table
-- The current policy blocks all access, even for SECURITY DEFINER functions
-- We need to allow system functions to work while still maintaining security
-- Drop the overly restrictive policy
DROP POLICY IF EXISTS "System access only" ON book_word_count_queue;
-- Create a proper policy that allows system functions to work
-- Since this table is only used by system functions, we can be more permissive
CREATE POLICY "Allow system functions" ON book_word_count_queue
FOR ALL USING (true);