fix(aihr): version SOP traceability migration

This commit is contained in:
2026-07-14 16:18:59 +08:00
parent 52af9b6e4c
commit 0609bd3d17
4 changed files with 69 additions and 1 deletions
@@ -23,6 +23,22 @@ PREPARE aihr_sop_source_stmt FROM @aihr_sop_source_ddl;
EXECUTE aihr_sop_source_stmt;
DEALLOCATE PREPARE aihr_sop_source_stmt;
SET @aihr_sop_prompt_version_exists := (
SELECT COUNT(*)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'aihr_sop_answer_review'
AND COLUMN_NAME = 'prompt_version'
);
SET @aihr_sop_prompt_version_ddl := IF(
@aihr_sop_review_table_exists = 1 AND @aihr_sop_prompt_version_exists = 0,
'ALTER TABLE aihr_sop_answer_review ADD COLUMN `prompt_version` varchar(80) DEFAULT NULL COMMENT ''答案生成提示词版本''',
'SELECT 1'
);
PREPARE aihr_sop_prompt_version_stmt FROM @aihr_sop_prompt_version_ddl;
EXECUTE aihr_sop_prompt_version_stmt;
DEALLOCATE PREPARE aihr_sop_prompt_version_stmt;
SET @aihr_sop_requester_exists := (
SELECT COUNT(*)
FROM information_schema.COLUMNS