-- Refresh PostgREST Schema Cache
-- Run this in Supabase SQL Editor to force PostgREST to reload the schema cache

-- Method 1: Use NOTIFY (recommended)
NOTIFY pgrst, 'reload schema';

-- Method 2: Force refresh by making a dummy change
ALTER TABLE processing_jobs ADD COLUMN IF NOT EXISTS _temp_refresh BOOLEAN DEFAULT FALSE;
ALTER TABLE processing_jobs DROP COLUMN IF EXISTS _temp_refresh;

-- Method 3: Update table comment (fixed syntax)
DO $$
BEGIN
  EXECUTE 'COMMENT ON TABLE processing_jobs IS ''Stores document processing jobs - Cache refreshed at ' || NOW()::text || '''';
END $$;

