-- 给 BookChapter 加 audioSource 字段，区分完整异步生成 vs on-demand 同步合成
ALTER TABLE `BookChapter` ADD COLUMN `audioSource` VARCHAR(20) NULL;

-- 已有数据回填：有合法音频（且非 /uploads/）的标记为 'full'；空标记为 NULL
UPDATE `BookChapter`
SET `audioSource` = 'full'
WHERE `audioUrl` IS NOT NULL
  AND `audioUrl` != ''
  AND `audioUrl` NOT LIKE '/uploads/%';