-- 2.0之后的SQL变更 alter table vp_user add status int default 0 null comment '账号状态 0正常 1停用' after role_code; alter table vp_config_drug add interval_hour varchar(64) null comment '用药间隔(小时)' after interval_day; alter table vp_disease_ancillary modify result text null comment '结果'; alter table vp_disease_ancillary add normal_result varchar(1024) null comment '正常结果' after result; alter table vp_disease_physical modify result text null comment '结果'; alter table vp_disease_physical add normal_result varchar(1024) null comment '正常结果' after result; alter table vp_config_drug add first_measures_id varchar(64) null comment '一级措施id' after drug_name_en; -- 添加注释 alter table vp_treatment_plan_record modify treatment_plan_id varchar(64) null comment '处置计划id 对应与vp_treatment_plan表中的id'; alter table vp_treatment_plan_record modify disposal_plan varchar(64) null comment '处置计划 废弃字段:对应与vp_treatment_plan表中的disposal_plan_id,根据treatment_plan_id可以获取到'; alter table vp_treatment_plan_record modify first_measures varchar(64) null comment '一级措施 废弃字段:对应与vp_treatment_plan表中的firstMeasures,根据treatment_plan_id可以获取到'; alter table vp_treatment_plan_record modify drug_id varchar(64) null comment '药品编码 当treatment_plan_id 为空时,drug_id 不应该为空'; -- 添加注释 alter table vp_ask_template_question_library modify description varchar(255) null comment '中文注释 用户设置的问题'; alter table vp_ask_template_question_library modify question json null comment '问题列表 由用户传入的问题生成的问题列表'; -- 修改字段类型 alter table vp_rasa_model_info modify train_log longtext null comment '训练日志'; alter table vp_rasa_model_info modify run_log longtext null comment '运行日志'; -- 修改药物表字段类型 alter table vp_config_drug modify interval_hour double null comment '用药间隔(小时)'; alter table vp_config_drug modify interval_day integer null comment '用药间隔'; -- 增加默认值 ALTER TABLE vp_config_ancillary_item MODIFY COLUMN update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP; ALTER TABLE vp_config_ancillary_item MODIFY COLUMN update_time datetime DEFAULT CURRENT_TIMESTAMP; -- 在病例表中允许patient_id为空 alter table vp_medical_rec modify patient_id varchar(64) null comment '病人ID'; alter table vp_disease_treatment_plan_drug add disease_treatment_plan_id varchar(64) null comment '疾病处置计划id;初始设计的时候是希望 diseaseId 和 treatmentPlanId 关联 DiseaseTreatmentPlan表中的 diseaseId,treatmentPlanId, 后面由于疾病没有使用到treatmentPlanId(统一设置为20),所以只根据diseaseId,treatmentPlanId无法区分出某一种处置计划对应的药物' after treatment_plan_id; alter table vp_disease modify symptom varchar(512) null comment '症状'; -- 添加表 vp_material_library create table vp_material_library ( id varchar(64) not null comment '主键', file_resource_id varchar(64) not null comment '文件资源id 对应vp_file_resource的主键', material_name varchar(64) not null comment '素材名称;不采用vp_file_resource中的file_name字段', material_type varchar(16) null comment '素材类型 0:图片 1:视频 2:音频', create_user_id varchar(64) null comment '创建人ID', create_time datetime(0) default CURRENT_TIMESTAMP(0) null comment '创建时间', update_user_id varchar(64) null comment '更新人', update_time datetime(0) default CURRENT_TIMESTAMP(0) null comment '更新时间' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC comment '素材库表'; alter table vp_material_library add directory_id varchar(64) null comment '目录id 对应于 vp_directory_info表的主键' after material_type; -- 修改字段长度 alter table vp_file_resource modify file_type varchar(128) null comment '文件类型'; -- 添加字段 alter table vp_ask_patient_answer add answer_type varchar(16) null comment '回答类型 0:默认回答 1:自定义回答' after answer_resource_id; create table vp_directory_info ( id varchar(64) not null comment '主键', directoryName varchar(64) not null comment '目录名称', parentId varchar(64) not null comment '父级id', create_user_id varchar(64) null comment '创建人ID', create_time datetime(0) default CURRENT_TIMESTAMP(0) null comment '创建时间', update_user_id varchar(64) null comment '更新人', update_time datetime(0) default CURRENT_TIMESTAMP(0) null comment '更新时间' ) comment '目录表'; -- 添加头像字段 alter table vp_medical_rec add patient_head_pic varchar(64) null comment '病人头像 对应vp_file_resource表的id' after patient_name;