mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 10:31:13 -05:00
Refactor: Fix notification view security
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- Add helper function for cleanup edge function
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.get_orphaned_edit_history()
|
||||
RETURNS TABLE (id UUID) AS $$
|
||||
BEGIN
|
||||
RETURN QUERY
|
||||
SELECT ieh.id
|
||||
FROM item_edit_history ieh
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM submission_items si
|
||||
WHERE si.id = ieh.item_id
|
||||
);
|
||||
END;
|
||||
$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = public;
|
||||
Reference in New Issue
Block a user