-- 回填历史数据中空的作品编号（与运行时生成形态一致：W{contestId}-* / H{homeworkId}-*）

UPDATE t_biz_contest_work
SET work_no = CONCAT('W', contest_id, '-', id)
WHERE work_no IS NULL OR TRIM(work_no) = '';

UPDATE t_biz_homework_submission
SET work_no = CONCAT('H', homework_id, '-', id)
WHERE work_no IS NULL OR TRIM(work_no) = '';
