fix: drop write_audit_log before recreate to handle existing function with different param names

This commit is contained in:
2026-07-11 14:50:03 +08:00
parent dbbb663611
commit a718a2ddbb
@@ -14,6 +14,7 @@ ALTER TABLE investigations
ADD COLUMN IF NOT EXISTS fishbone_categories JSONB; ADD COLUMN IF NOT EXISTS fishbone_categories JSONB;
-- Audit log write helper — SECURITY DEFINER so callers cannot bypass RLS -- Audit log write helper — SECURITY DEFINER so callers cannot bypass RLS
DROP FUNCTION IF EXISTS public.write_audit_log CASCADE;
CREATE OR REPLACE FUNCTION public.write_audit_log( CREATE OR REPLACE FUNCTION public.write_audit_log(
p_table_name TEXT, p_table_name TEXT,
p_record_id UUID, p_record_id UUID,