-- 诊单挂号 / 取消挂号操作日志（谁在何时操作）
-- 执行前确认表前缀为 zyt_

CREATE TABLE IF NOT EXISTS `zyt_tcm_diagnosis_guahao_log` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `diagnosis_id` int unsigned NOT NULL DEFAULT '0' COMMENT '诊单 id（doctor_appointment.patient_id）',
  `appointment_id` int unsigned NOT NULL DEFAULT '0' COMMENT '挂号记录 id',
  `admin_id` int unsigned NOT NULL DEFAULT '0' COMMENT '操作人管理员 id',
  `admin_name` varchar(64) NOT NULL DEFAULT '' COMMENT '操作人姓名',
  `action` varchar(32) NOT NULL DEFAULT '' COMMENT 'create=挂号 cancel=取消挂号',
  `summary` varchar(500) NOT NULL DEFAULT '' COMMENT '摘要',
  `create_time` int unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_diagnosis_id` (`diagnosis_id`),
  KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='诊单挂号操作日志';
