-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apps/chat-with-pdf): add new migration file
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
apps/chat-with-pdf/supabase/migrations/20241103005601_remote_schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
create extension if not exists "vector" with schema "public" version '0.7.0'; | ||
|
||
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'); | ||
|
||
RETURN OLD; | ||
END; | ||
$function$ | ||
; | ||
|
||
CREATE TRIGGER chat_delete_trigger AFTER DELETE ON public."Chat" FOR EACH ROW EXECUTE FUNCTION remove_document_file_after_removing_chats(); | ||
|
||
|