From bbb1ccd83e4a4e9af04c50340f749c62d82a7c6d Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Wed, 24 Jan 2024 22:16:13 +0100 Subject: [PATCH] fix: only migrate workspaces that exist --- .../supabase/migrations/20240124165527_workspace_files.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/browser/supabase/migrations/20240124165527_workspace_files.sql b/apps/browser/supabase/migrations/20240124165527_workspace_files.sql index 5db883f0..3b0ff68e 100644 --- a/apps/browser/supabase/migrations/20240124165527_workspace_files.sql +++ b/apps/browser/supabase/migrations/20240124165527_workspace_files.sql @@ -18,8 +18,9 @@ INSERT INTO "public"."workspace_files" ("chat_id", "path") SELECT "path_tokens"[1]::uuid as "chat_id", "name" as "path" -from +FROM storage.objects +JOIN chats ON chats.id = "path_tokens"[1]::uuid where bucket_id = 'workspaces';