-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sort key for oshis #56
Open
csm-kb
wants to merge
7
commits into
main
Choose a base branch
from
32-add-sort-key-for-oshis
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9bbe061
supabase: ensure seed + holostars migrations are idempotent
csm-kb dd2cf7b
supabase: migrations to cover initial talent seeding
csm-kb fbcf1b9
supabase: migration for adding sort keys to talents by gen
csm-kb c6d087f
mypass: use sort_order to order talent fetch
csm-kb 6177cc1
mypass: expose form errors on edit page
csm-kb db7f1c4
mypass: remove zod limit for UNLIMITED TALENTS
csm-kb 539e640
mypass: use sort_order in loadOshi for display
csm-kb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,57 @@ | ||
-- First transaction: Add new enum values | ||
ALTER TYPE "Generation" ADD VALUE 'STARS Gen 1'; | ||
ALTER TYPE "Generation" ADD VALUE 'STARS Gen 2'; | ||
ALTER TYPE "Generation" ADD VALUE 'STARS Gen 3'; | ||
ALTER TYPE "Generation" ADD VALUE 'UPROAR!!'; | ||
ALTER TYPE "Generation" ADD VALUE 'TEMPUS HQ'; | ||
ALTER TYPE "Generation" ADD VALUE 'TEMPUS VG'; | ||
ALTER TYPE "Generation" ADD VALUE 'ARMIS'; | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'STARS Gen 1'; | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'STARS Gen 2'; | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'STARS Gen 3'; | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'UPROAR!!'; | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'TEMPUS HQ'; | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'TEMPUS VG'; | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'ARMIS'; | ||
|
||
-- Commit the first transaction | ||
COMMIT; | ||
|
||
-- Second transaction: Insert new records | ||
INSERT INTO talents ( | ||
name_en, name_jp, gen, fanmark | ||
) VALUES | ||
) VALUES | ||
-- STARS Gen 1 | ||
('Hanasaki Miyabi', '花咲みやび', 'STARS Gen 1', '🌺'), | ||
('Kanade Izuru', '奏手イヅル', 'STARS Gen 1', '🎸'), | ||
('Arurandeisu', 'アルランディス', 'STARS Gen 1', '🍕'), | ||
('Rikka', '律可', 'STARS Gen 1', '⚙️'), | ||
('Kagami Kira', '鏡見キラ', 'Alum', '💙'), | ||
('Yakushiji Suzaku', '薬師寺朱雀', 'Alum', '💊'), | ||
-- STARS Gen 2 | ||
('Astel Leda', 'アステル・レダ', 'STARS Gen 2', '🎭'), | ||
('Kishido Temma', '岸堂天真', 'STARS Gen 2', '🦔💨'), | ||
('Yukoku Roberu', '夕刻ロベル', 'STARS Gen 2', '🍷'), | ||
-- STARS Gen 3 | ||
('Kageyama Shien', '影山シエン', 'STARS Gen 3', '🟣'), | ||
('Aragami Oga', '荒咬オウガ', 'STARS Gen 3', '🐃'), | ||
('Tsukishita Kaoru', '月下カオル', 'Alum', '💅'), | ||
-- UPROAR!! | ||
('Yatogami Fuma', '夜十神封魔', 'UPROAR!!', '🦝'), | ||
('Utsugi Uyu', '羽継烏有', 'UPROAR!!', '🃏'), | ||
('Minase Rio', '水無世燐央', 'UPROAR!!', '🕯️'), | ||
('Hizaki Gamma', '緋崎ガンマ', 'Alum', '🖌️'), | ||
-- TEMPUS HQ | ||
('Regis Altare', 'リージス・アルテア', 'TEMPUS HQ', '🎇'), | ||
('Axel Syrios', 'アクセル・シリオス', 'TEMPUS HQ', '⛓️'), | ||
('Magni Dezmond', 'マグニ・デズモンド', 'Alum', '🧤'), | ||
('Noir Vesper', 'ノワール・ヴェスパー', 'Alum', '📗'), | ||
-- TEMPUS VG | ||
('Gavis Bettel', 'ガビス・ベッテル', 'TEMPUS VG', '🎩'), | ||
('Machina X Flayon', 'マキナ・X・フレオン', 'TEMPUS VG', '🪫'), | ||
('Banzoin Hakka', '万象院ハッカ', 'TEMPUS VG', '🔅'), | ||
('Josuiji Shinri', '定水寺シンリ', 'TEMPUS VG', '🏹'), | ||
-- ARMIS | ||
('Jurard T Rexford', 'ジュラルド・ティー・レクスフォード', 'ARMIS', '🦖'), | ||
('Goldbullet', 'ゴールドブレット', 'ARMIS', '🦅'), | ||
('Octavio', 'オクタビオ', 'ARMIS', 'ထ'), | ||
('Crimzon Ruze', 'クリムゾン・ルーズ', 'ARMIS', '💢'); | ||
('Crimzon Ruze', 'クリムゾン・ルーズ', 'ARMIS', '💢') | ||
ON CONFLICT (name_en) DO UPDATE | ||
SET | ||
name_jp = EXCLUDED.name_jp, | ||
fanmark = EXCLUDED.fanmark, | ||
gen = EXCLUDED.gen | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
INSERT INTO talents ( | ||
name_en, name_jp, fanmark, gen | ||
) VALUES | ||
-- JP: Gen 0 | ||
('Tokino Sora', 'ときのそら', '🐻', 'Gen 0'), | ||
('Roboco-san', 'ロボ子さん', '🤖', 'Gen 0'), | ||
('Sakura Miko', 'さくらみこ', '🌸', 'Gen 0'), | ||
('Hoshimachi Suisei', '星街すいせい', '☄️', 'Gen 0'), | ||
('AZKi', 'AZKi', '⚒️', 'Gen 0'), | ||
-- JP: Gen 1 | ||
('Shirakami Fubuki', '白上フブキ', '🌽', 'Gen 1'), | ||
('Natsuiro Matsuri', '夏色まつり', '🏮', 'Gen 1'), | ||
('Akai Haato', '赤井はあと', '❤️🔥', 'Gen 1'), | ||
('Aki Rosenthal', 'アキ・ローゼンタール', '🍎', 'Gen 1'), | ||
('Yozora Mel', '夜空メル', '🌟', 'Gen 1'), | ||
-- JP: Gen 2 | ||
('Minato Aqua', '湊あくあ', '⚓️', 'Gen 2'), | ||
('Murasaki Shion', '紫咲シオン', '🌙', 'Gen 2'), | ||
('Nakiri Ayame', '百鬼あやめ', '😈', 'Gen 2'), | ||
('Yuzuki Choco', '癒月ちょこ', '💋', 'Gen 2'), | ||
('Oozora Subaru', '大空スバル', '🚑', 'Gen 2'), | ||
-- JP: GAMERS | ||
('Ookami Mio', '大神ミオ', '🌲', 'GAMERS'), | ||
('Nekomata Okayu', '猫又おかゆ', '🍙', 'GAMERS'), | ||
('Inugami Korone', '戌神ころね', '🥐', 'GAMERS'), | ||
-- JP: Gen 3 | ||
('Usada Pekora', '兎田ぺこら', '👯', 'Gen 3'), | ||
('Shiranui Flare', '不知火フレア', '🔥', 'Gen 3'), | ||
('Shirogane Noel', '白銀ノエル', '⚔️', 'Gen 3'), | ||
('Houshou Marine', '宝鐘マリン', '🏴☠️', 'Gen 3'), | ||
-- JP: Gen 4 | ||
('Amane Kanata', '天音かなた', '💫', 'Gen 4'), | ||
('Tsunomaki Watame', '角巻わため', '🐏', 'Gen 4'), | ||
('Tokoyami Towa', '常闇トワ', '👾', 'Gen 4'), | ||
('Himemori Luna', '姫森ルーナ', '🍬', 'Gen 4'), | ||
-- JP: Gen 5 | ||
('Yukihana Lamy', '雪花ラミィ', '☃️', 'Gen 5'), | ||
('Momosuzu Nene', '桃鈴ねね', '🍑', 'Gen 5'), | ||
('Shishiro Botan', '獅白ぼたん', '♌', 'Gen 5'), | ||
('Omaru Polka', '尾丸ポルカ', '🎪', 'Gen 5'), | ||
-- JP: holoX | ||
('La+ Darknesss', 'ラプラス・ダークネス', '🛸', 'holoX'), | ||
('Takane Lui', '鷹嶺ルイ', '🥀', 'holoX'), | ||
('Hakui Koyori', '博衣こより', '🧪', 'holoX'), | ||
('Sakamata Chloe', '沙花叉クロヱ', '🎣', 'holoX'), | ||
('Kazama Iroha', '風真いろは', '🍃', 'holoX'), | ||
-- ID | ||
('Ayunda Risu', 'アユンダ・リス', '🐿️', 'Indonesia'), | ||
('Moona Hoshinova', 'ムーナ・ホシノヴァ', '🔮', 'Indonesia'), | ||
('Airani Iofifteen', 'アイラニ・イオフィフティーン', '🎨', 'Indonesia'), | ||
('Kureiji Ollie', 'クレイジー・オリー', '🧟♀️', 'Indonesia'), | ||
('Anya Melfissa', 'アーニャ・メルフィッサ', '🍂', 'Indonesia'), | ||
('Pavolia Reine', 'パヴォリア・レイネ', '🦚', 'Indonesia'), | ||
('Vestia Zeta', 'ベスティア・ゼータ', '📜', 'Indonesia'), | ||
('Kaela Kovalskia', 'カエラ・コヴァルスキア', '🔨', 'Indonesia'), | ||
('Kobo Kanaeru', 'こぼ・かなえる', '☔', 'Indonesia'), | ||
-- EN: Myth | ||
('Mori Calliope', 'もりかりおぺ', '💀', 'Myth'), | ||
('Takanashi Kiara', 'たかなしきあら', '🐔', 'Myth'), | ||
('Ninomae Ina''nis', '一伊那尓栖/にのまえいなにす', '🐙', 'Myth'), | ||
('Gawr Gura', 'がうる・ぐら', '🔱', 'Myth'), | ||
('Watson Amelia', 'ワトソン・アメリア', '🔎', 'Myth'), | ||
-- EN: Promise | ||
('IRyS', 'IRyS', '💎', 'Promise'), | ||
('Ceres Fauna', 'セレス・ファウナ', '🌿', 'Promise'), | ||
('Ouro Kronii', 'オーロ・クロニー', '⌛', 'Promise'), | ||
('Nanashi Mumei', '七詩ムメイ', '🪶', 'Promise'), | ||
('Hakos Baelz', 'ハコス・ベールズ', '🎲', 'Promise'), | ||
-- EN: Advent | ||
('Shiori Novella', 'シオリ・ノヴェラ', '👁️🗨️', 'Advent'), | ||
('Koseki Bijou', '古石ビジュー', '🗿', 'Advent'), | ||
('Nerissa Ravencroft', 'ネリッサ・レイヴンクロフト', '🎼', 'Advent'), | ||
('Fuwawa Abyssgard', 'フワワ・アビスガード', '🐾🩵', 'Advent'), | ||
('Mococo Abyssgard', 'モココ・アビスガード', '🐾🩷 ', 'Advent'), | ||
-- JP: ReGLOSS | ||
('Hiodoshi Ao', '火威青', '🖋️', 'ReGLOSS'), | ||
('Otonose Kanade', '音乃瀬奏', '🎹✨', 'ReGLOSS'), | ||
('Ichijou Ririka', '一条莉々華', '🌃', 'ReGLOSS'), | ||
('Juufuutei Raden', '儒烏風亭らでん', '🐚', 'ReGLOSS'), | ||
('Todoroki Hajime', '轟はじめ', '🐧⚡️', 'ReGLOSS'), | ||
-- Office Staff | ||
('A-chan', '友人A', '👓', 'Office Staff'), | ||
('Harusaki Nodoka', '春先のどか', '📝', 'Office Staff') | ||
ON CONFLICT (name_en) DO UPDATE | ||
SET | ||
name_jp = EXCLUDED.name_jp, | ||
fanmark = EXCLUDED.fanmark, | ||
gen = EXCLUDED.gen | ||
; |
24 changes: 24 additions & 0 deletions
24
supabase/migrations/20250202170736_add_justice_flowglow.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'Justice'; | ||
ALTER TYPE "Generation" ADD VALUE IF NOT EXISTS 'FLOW GLOW'; | ||
COMMIT; | ||
|
||
INSERT INTO talents ( | ||
name_en, name_jp, fanmark, gen | ||
) VALUES | ||
-- Justice | ||
('Elizabeth Rose Bloodflame', 'エリザベス・ローズ・ブラッドフレイム', '💄', 'Justice'), | ||
('Gigi Murin', 'ジジ・ムリン', '👧', 'Justice'), | ||
('Cecilia Immergreen', 'セシリア・イマーグリーン', '🍵', 'Justice'), | ||
('Raora Panthera', 'ラオーラ・パンテーラ', '🐱', 'Justice'), | ||
-- FLOW GLOW | ||
('Isaki Riona', '響咲リオナ', '🎤👑', 'FLOW GLOW'), | ||
('Koganei Niko', '虎金妃笑虎', '☺️🐅', 'FLOW GLOW'), | ||
('Mizumiya Su', '水宮枢', '💬', 'FLOW GLOW'), | ||
('Rindo Chihaya', '輪堂 千速', '🎧🔧', 'FLOW GLOW'), | ||
('Kikirara Vivi', '綺々羅々ヴィヴィ', '💅✨', 'FLOW GLOW') | ||
ON CONFLICT (name_en) DO UPDATE | ||
SET | ||
name_jp = EXCLUDED.name_jp, | ||
fanmark = EXCLUDED.fanmark, | ||
gen = EXCLUDED.gen | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
INSERT INTO talents ( | ||
name_en, name_jp, fanmark, gen | ||
) VALUES | ||
('Tsukumo Sana', '九十九 佐命', '🪐', 'Alum') | ||
ON CONFLICT (name_en) DO UPDATE | ||
SET | ||
name_jp = EXCLUDED.name_jp, | ||
fanmark = EXCLUDED.fanmark, | ||
gen = EXCLUDED.gen | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
UPDATE talents | ||
SET gen = 'Alum' | ||
WHERE name_en in ( | ||
'Watson Amelia', | ||
'Ceres Fauna', | ||
'Sakamata Chloe' | ||
); |
46 changes: 46 additions & 0 deletions
46
supabase/migrations/20250302115105_add_talents_sort_key.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
ALTER TABLE talents | ||
ADD COLUMN IF NOT EXISTS sort_order INTEGER NOT NULL DEFAULT 0 | ||
; | ||
|
||
-- Set gen debut orders, grouped by branch | ||
WITH debut_order AS ( | ||
SELECT gen, sort_order FROM ( | ||
VALUES | ||
-- Hololive: JP | ||
('Gen 0', 0), | ||
('Gen 1', 1), | ||
('Gen 2', 2), | ||
('GAMERS', 3), | ||
('Gen 3', 4), | ||
('Gen 4', 5), | ||
('Gen 5', 6), | ||
('holoX', 7), | ||
-- Hololive: DEV_IS | ||
('ReGLOSS', 100), | ||
('FLOW GLOW', 101), | ||
-- Hololive: ID | ||
('Indonesia', 200), | ||
-- Hololive: EN | ||
('Myth', 300), | ||
('Promise', 301), | ||
('Advent', 302), | ||
('Justice', 303), | ||
-- Holostars: JP | ||
('STARS Gen 1', 1000), | ||
('STARS Gen 2', 1001), | ||
('STARS Gen 3', 1002), | ||
('UPROAR!!', 1003), | ||
-- Holostars: EN | ||
('TEMPUS HQ', 1100), | ||
('TEMPUS VG', 1101), | ||
('ARMIS', 1102), | ||
-- Cover | ||
('Alum', 2000), | ||
('Office Staff', 2001) | ||
) s(gen, sort_order) | ||
) | ||
UPDATE talents | ||
SET sort_order = debut_order.sort_order | ||
FROM debut_order | ||
WHERE talents.gen = debut_order.gen::"Generation" | ||
; |
Large diffs are not rendered by default.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this tabbing looks weird because GitHub doesn't render it the aligned way you see it in VS Code... ignore!