DELIMITER
??
DROP PROCEDURE IF EXISTS schema_change ??
CREATE PROCEDURE schema_change()
BEGIN


-- 培训任务表增加主持人名称字段
    IF
    NOT EXISTS(SELECT *
                      FROM information_schema.columns
                      WHERE table_schema = DATABASE()
                        AND table_name = 'core_monitoring_task_registration'
                        AND column_name = 'task_end_time') THEN
    alter table core_monitoring_task_registration
        add task_end_time datetime DEFAULT NULL COMMENT '调阅任务填报结束时间' after end_picture;
    END IF;

    IF
    NOT EXISTS(SELECT *
                      FROM information_schema.columns
                      WHERE table_schema = DATABASE()
                        AND table_name = 'core_monitoring_retrieval_task'
                        AND column_name = 'duration_total') THEN
    alter table core_monitoring_retrieval_task
        add duration_total double(10,4) DEFAULT NULL COMMENT '调阅总时长' after sign_img;
    END IF;




END ??
DELIMITER ;
CALL schema_change();


DELETE FROM quartz.sys_job where job_name = '回归未完成的调阅任务';