-- Migration: 00029_fix_function_search_path_again
-- Description: Re-apply search_path fixes for functions recreated in 00025
-- Author: Dirt
-- Date: 2025-01-XX
--
-- Rationale:
-- Functions search_reviews and get_feed_reviews were recreated in migration 00025
-- without the search_path setting. This migration re-applies the security fix.
-- Setting a fixed search_path prevents role/session-level search_path changes
-- from altering function behavior (security issue 0011_function_search_path_mutable).
-- We use "pg_catalog, public" to ensure built-in functions resolve safely while
-- preserving existing unqualified references to tables in the public schema.

ALTER FUNCTION public.search_reviews(TEXT, gender, TEXT, TEXT, INTEGER, INTEGER)
  SET search_path = pg_catalog, public;

ALTER FUNCTION public.get_feed_reviews(gender, INTEGER, INTEGER)
  SET search_path = pg_catalog, public;




