
-- Add CHECK constraints to prevent abuse of search_logs table
ALTER TABLE public.search_logs
ADD CONSTRAINT search_logs_search_term_length CHECK (length(search_term) <= 500),
ADD CONSTRAINT search_logs_contact_email_length CHECK (length(contact_email) <= 254),
ADD CONSTRAINT search_logs_contact_phone_length CHECK (length(contact_phone) <= 20),
ADD CONSTRAINT search_logs_selected_address_id_length CHECK (length(selected_address_id) <= 100),
ADD CONSTRAINT search_logs_selected_address_formatted_length CHECK (length(selected_address_formatted) <= 500);
