Skip to content

Commit

Permalink
fix(apps/chat-with-pdf): fix migration history
Browse files Browse the repository at this point in the history
  • Loading branch information
dartilesm committed Nov 9, 2024
1 parent 551d2e5 commit 7220c5c
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ set check_function_bodies = off;
CREATE OR REPLACE FUNCTION public.remove_document_file_after_removing_chats()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
BEGIN
PERFORM remove_file('documents', OLD.id::text || '.pdf');

AS $function$BEGIN
DELETE FROM storage.objects
WHERE bucket_id = 'documents' AND name = OLD.id || '.pdf';
RETURN OLD;
END;
$function$
END;$function$
;

CREATE TRIGGER chat_delete_trigger AFTER DELETE ON public."Chat" FOR EACH ROW EXECUTE FUNCTION remove_document_file_after_removing_chats();


0 comments on commit 7220c5c

Please sign in to comment.