-- 修正章节排序索引，与 8 分类体系对齐
-- childhood=0, education=1, career_early=2, career_achievement=3,
-- career_challenge=4, family=5, beliefs=6, summary=7
UPDATE chapters SET order_index = 0 WHERE category = 'childhood' AND order_index != 0;
UPDATE chapters SET order_index = 1 WHERE category = 'education' AND order_index != 1;
UPDATE chapters SET order_index = 2 WHERE category = 'career_early' AND order_index != 2;
UPDATE chapters SET order_index = 3 WHERE category = 'career_achievement' AND order_index != 3;
UPDATE chapters SET order_index = 4 WHERE category = 'career_challenge' AND order_index != 4;
UPDATE chapters SET order_index = 5 WHERE category = 'family' AND order_index != 5;
UPDATE chapters SET order_index = 6 WHERE category IN ('belief', 'beliefs') AND order_index != 6;
UPDATE chapters SET order_index = 7 WHERE category = 'summary' AND order_index != 7;

-- 旧的 5-stage "career" 章节归入 career_early
UPDATE chapters SET category = 'career_early', order_index = 2
  WHERE category = 'career';

-- 旧的 "belief" 统一为 "beliefs"
UPDATE chapters SET category = 'beliefs'
  WHERE category = 'belief';
