From bccd07021e4e724ccef0732ecc6ce99ddad62684 Mon Sep 17 00:00:00 2001 From: Jason Laster Date: Fri, 21 Mar 2025 11:42:16 -0700 Subject: [PATCH] Migrate to blobs for repository_contents, solution, and prompt --- app/lib/supabase/problems.ts | 63 ++++++++++++++++++++++++++++- migrate-problems/insert-problems.ts | 1 + tsconfig.json | 1 + 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/app/lib/supabase/problems.ts b/app/lib/supabase/problems.ts index 1d39e345..bd495f3f 100644 --- a/app/lib/supabase/problems.ts +++ b/app/lib/supabase/problems.ts @@ -71,11 +71,69 @@ export async function supabaseGetProblem(problemId: string): Promise ({ id: comment.id, timestamp: comment.created_at, diff --git a/migrate-problems/insert-problems.ts b/migrate-problems/insert-problems.ts index 21c04c14..46e45bba 100644 --- a/migrate-problems/insert-problems.ts +++ b/migrate-problems/insert-problems.ts @@ -121,6 +121,7 @@ async function importProblems(): Promise { async function uploadBlob(bucket: string, path: string, contents: string) { const { error } = await supabase.storage.from(bucket).upload(path, contents); + // @ts-ignore if (error && error.error !== 'Duplicate') { console.error(` ❌ Error uploading ${path}:`, error.message, error); throw error; diff --git a/tsconfig.json b/tsconfig.json index 9b00e84b..fce937c7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,7 @@ // vite takes care of building everything, not tsc "noEmit": true }, + "exclude": ["migrate-problems/**/*.ts"], "include": [ "**/*.ts", "**/*.tsx",