Initial commit: PastPaper Master full stack
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
supabase/migrations/008_fix_storage_url_placeholder.sql
Normal file
27
supabase/migrations/008_fix_storage_url_placeholder.sql
Normal 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__%';
|
||||
Reference in New Issue
Block a user