DROP TABLE IF EXISTS requirement_prototypes;
-- 回滚前把 prototyping 行归并到 planning，否则重建不含 prototyping 的 CHECK 会失败。
UPDATE requirements SET phase = 'planning' WHERE phase = 'prototyping';
ALTER TABLE requirements DROP CONSTRAINT requirements_phase_check;
ALTER TABLE requirements ADD CONSTRAINT requirements_phase_check
  CHECK (phase IN ('planning','auditing','implementing','reviewing','done'));
