-- -----------------------------------------------------------------------------------
-- 评价题目表中增加题目类型和选项内容
-- ----------------------------------------------------------------------------------- 
ALTER TABLE `evaluate_item`   
  ADD COLUMN `type` VARCHAR(50) NULL   COMMENT '题目类型' AFTER `input_not_null`,
  ADD COLUMN `option_json` TEXT NULL   COMMENT '选项内容' AFTER `type`;
  

-- -----------------------------------------------------------------------------------
-- 评价题目表中增加题目类型和选项内容
-- ----------------------------------------------------------------------------------- 
ALTER TABLE `evaluate_manage_item`   
  ADD COLUMN `type` VARCHAR(50) NULL   COMMENT '题目类型' AFTER `input_not_null`,
  ADD COLUMN `option_json` TEXT NULL   COMMENT '选项内容' AFTER `type`;


-- -----------------------------------------------------------------------------------
-- 可是统计增加：课时补充数据，表头动态
-- ----------------------------------------------------------------------------------- 
DROP PROCEDURE IF EXISTS createCom;
DELIMITER $$
CREATE
    PROCEDURE createCom()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='class_time_statistics_record' AND COLUMN_NAME = 'course_time_type_data') THEN
ALTER TABLE `class_time_statistics_record`   
  ADD COLUMN `course_time_type_data` LONGTEXT NULL   COMMENT '课时补充数据，表头动态' AFTER `all_class_time_data`;
END IF;
END$$
DELIMITER ;
CALL createCom;
DROP PROCEDURE createCom;


DROP PROCEDURE IF EXISTS createCom;
DELIMITER $$
CREATE
    PROCEDURE createCom()
BEGIN
    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='evaluate_result' AND COLUMN_NAME = 'option_content') THEN
ALTER TABLE `evaluate_result`   
  ADD COLUMN `option_content` VARCHAR(500) NULL   COMMENT '选项内容' AFTER `submit_record_id`;
END IF;
END$$
DELIMITER ;
CALL createCom;
DROP PROCEDURE createCom;


