Initial commit: PastPaper Master full stack

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zhao
2026-04-21 12:15:35 +07:00
commit 7a09167261
105 changed files with 24799 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
-- 008: Replace __SUPABASE_STORAGE_PUBLIC_BASE_URL__ placeholder in paper URLs
--
-- The course-library seed (comp2211_course_library_papers.sql) was inserted
-- without substituting the placeholder. This migration replaces it with the
-- real Supabase Storage public base URL for the `papers` bucket.
UPDATE papers
SET paper_file_url = REPLACE(
paper_file_url,
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__',
'https://pvcxipwovpwrurebouwg.supabase.co/storage/v1/object/public/papers'
)
WHERE paper_file_url LIKE '%__SUPABASE_STORAGE_PUBLIC_BASE_URL__%';
UPDATE papers
SET answer_file_url = REPLACE(
answer_file_url,
'__SUPABASE_STORAGE_PUBLIC_BASE_URL__',
'https://pvcxipwovpwrurebouwg.supabase.co/storage/v1/object/public/papers'
)
WHERE answer_file_url LIKE '%__SUPABASE_STORAGE_PUBLIC_BASE_URL__%';
-- Verify: should return 0 rows
SELECT id, course_code, year, term, exam_type, paper_file_url, answer_file_url
FROM papers
WHERE paper_file_url LIKE '%__SUPABASE_STORAGE_PUBLIC_BASE_URL__%'
OR answer_file_url LIKE '%__SUPABASE_STORAGE_PUBLIC_BASE_URL__%';