Files
zyt/server/database/migrations/2026_09_10_prescription_ai_progress.sql
T
2026-09-10 15:19:17 +08:00

14 lines
779 B
SQL

-- Apply AFTER 2026_09_09_prescription_ai_analysis.sql and BEFORE deploying progress-aware code.
-- Additive, repeatable; encrypted model checkpoints and existing task states are unchanged.
SET @rx_ai_progress_exists = (
SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'zyt_prescription_ai_task' AND COLUMN_NAME = 'progress_json'
);
SET @rx_ai_progress_sql = IF(@rx_ai_progress_exists = 0,
'ALTER TABLE `zyt_prescription_ai_task` ADD COLUMN `progress_json` VARCHAR(2048) NULL COMMENT ''Public stage and counters only, no clinical content''',
'SET @rx_ai_progress_noop = 1'
);
PREPARE rx_ai_progress_statement FROM @rx_ai_progress_sql;
EXECUTE rx_ai_progress_statement;
DEALLOCATE PREPARE rx_ai_progress_statement;