From cc282ed00c501fb98580724cb3214088b7218200 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Thu, 26 Mar 2026 07:54:09 +0000 Subject: [PATCH 1/2] [#551] Backfill genre and language for E2E storylines 34-42 Map each storyline to the correct genre from lib/genres.ts and language from the E2E script metadata. Fixes "Uncategorized" display and broken language filter for Foundry-created storylines. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../00026_backfill_e2e_genre_language.sql | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 supabase/migrations/00026_backfill_e2e_genre_language.sql diff --git a/supabase/migrations/00026_backfill_e2e_genre_language.sql b/supabase/migrations/00026_backfill_e2e_genre_language.sql new file mode 100644 index 00000000..3ab75a76 --- /dev/null +++ b/supabase/migrations/00026_backfill_e2e_genre_language.sql @@ -0,0 +1,33 @@ +-- [#551] Backfill genre and language for E2E storylines (IDs 34-42) +-- +-- Storylines created via Foundry E2E scripts have no genre set and +-- language defaults to 'English'. This sets correct values based on +-- the storyline content. Genre values match lib/genres.ts GENRES list +-- exactly (case-sensitive). Language values match LANGUAGES list. + +-- 34: The Last Signal (Sci-Fi, English) +UPDATE storylines SET genre = 'Science Fiction', language = 'English' WHERE storyline_id = 34; + +-- 35: The Holloway Manuscript (Mystery, English) +UPDATE storylines SET genre = 'Mystery', language = 'English' WHERE storyline_id = 35; + +-- 36: The Ember Throne (Fantasy, English) +UPDATE storylines SET genre = 'Fantasy', language = 'English' WHERE storyline_id = 36; + +-- 37: Still Life with Shadows (Literary Fiction, English) +UPDATE storylines SET genre = 'Contemporary Lit', language = 'English' WHERE storyline_id = 37; + +-- 38: 붉은 달의 아이 (Horror, Korean) +UPDATE storylines SET genre = 'Horror', language = 'Korean' WHERE storyline_id = 38; + +-- 39: 風鈴の夏 (Slice of Life, Japanese) +UPDATE storylines SET genre = 'Contemporary Lit', language = 'Japanese' WHERE storyline_id = 39; + +-- 40: 碧血剑影 (Wuxia, Chinese) +UPDATE storylines SET genre = 'Historical Fiction', language = 'Chinese' WHERE storyline_id = 40; + +-- 41: El Jardín de las Mariposas Eternas (Magical Realism, Spanish) +UPDATE storylines SET genre = 'Fantasy', language = 'Spanish' WHERE storyline_id = 41; + +-- 42: L'Heure Bleue (Existential, French) +UPDATE storylines SET genre = 'Contemporary Lit', language = 'French' WHERE storyline_id = 42; From 09fa79eec73c50d1233976445db282d5e735d25e Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Thu, 26 Mar 2026 07:58:01 +0000 Subject: [PATCH 2/2] [#273] Add contract_address guard and fix storyline 41 genre Address T2a review: - Scope all UPDATEs to v4b factory (0x9D2AE1E9...) to prevent overwriting rows from other contracts - Change storyline 41 genre from 'Fantasy' to 'Others' per ticket Co-Authored-By: Claude Opus 4.6 (1M context) --- .../00026_backfill_e2e_genre_language.sql | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/supabase/migrations/00026_backfill_e2e_genre_language.sql b/supabase/migrations/00026_backfill_e2e_genre_language.sql index 3ab75a76..dc22ac60 100644 --- a/supabase/migrations/00026_backfill_e2e_genre_language.sql +++ b/supabase/migrations/00026_backfill_e2e_genre_language.sql @@ -4,30 +4,41 @@ -- language defaults to 'English'. This sets correct values based on -- the storyline content. Genre values match lib/genres.ts GENRES list -- exactly (case-sensitive). Language values match LANGUAGES list. +-- +-- All UPDATEs scoped to v4b factory to avoid touching other contracts. -- 34: The Last Signal (Sci-Fi, English) -UPDATE storylines SET genre = 'Science Fiction', language = 'English' WHERE storyline_id = 34; +UPDATE storylines SET genre = 'Science Fiction', language = 'English' + WHERE storyline_id = 34 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf'); -- 35: The Holloway Manuscript (Mystery, English) -UPDATE storylines SET genre = 'Mystery', language = 'English' WHERE storyline_id = 35; +UPDATE storylines SET genre = 'Mystery', language = 'English' + WHERE storyline_id = 35 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf'); -- 36: The Ember Throne (Fantasy, English) -UPDATE storylines SET genre = 'Fantasy', language = 'English' WHERE storyline_id = 36; +UPDATE storylines SET genre = 'Fantasy', language = 'English' + WHERE storyline_id = 36 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf'); -- 37: Still Life with Shadows (Literary Fiction, English) -UPDATE storylines SET genre = 'Contemporary Lit', language = 'English' WHERE storyline_id = 37; +UPDATE storylines SET genre = 'Contemporary Lit', language = 'English' + WHERE storyline_id = 37 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf'); -- 38: 붉은 달의 아이 (Horror, Korean) -UPDATE storylines SET genre = 'Horror', language = 'Korean' WHERE storyline_id = 38; +UPDATE storylines SET genre = 'Horror', language = 'Korean' + WHERE storyline_id = 38 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf'); -- 39: 風鈴の夏 (Slice of Life, Japanese) -UPDATE storylines SET genre = 'Contemporary Lit', language = 'Japanese' WHERE storyline_id = 39; +UPDATE storylines SET genre = 'Contemporary Lit', language = 'Japanese' + WHERE storyline_id = 39 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf'); -- 40: 碧血剑影 (Wuxia, Chinese) -UPDATE storylines SET genre = 'Historical Fiction', language = 'Chinese' WHERE storyline_id = 40; +UPDATE storylines SET genre = 'Historical Fiction', language = 'Chinese' + WHERE storyline_id = 40 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf'); -- 41: El Jardín de las Mariposas Eternas (Magical Realism, Spanish) -UPDATE storylines SET genre = 'Fantasy', language = 'Spanish' WHERE storyline_id = 41; +UPDATE storylines SET genre = 'Others', language = 'Spanish' + WHERE storyline_id = 41 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf'); -- 42: L'Heure Bleue (Existential, French) -UPDATE storylines SET genre = 'Contemporary Lit', language = 'French' WHERE storyline_id = 42; +UPDATE storylines SET genre = 'Contemporary Lit', language = 'French' + WHERE storyline_id = 42 AND lower(contract_address) = lower('0x9D2AE1E99D0A6300bfcCF41A82260374e38744Cf');