-- 消息表
CREATE TABLE `message` (
  `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `patient_id` INT UNSIGNED NOT NULL COMMENT '患者ID',
  `type` TINYINT NOT NULL DEFAULT 0 COMMENT '类型：1=审核通过 2=审核拒绝',
  `title` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '标题',
  `content` TEXT COMMENT '详细内容',
  `reason` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '驳回原因',
  `is_read` TINYINT NOT NULL DEFAULT 0 COMMENT '0=未读 1=已读',
  `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP,
  KEY `idx_patient_id` (`patient_id`),
  KEY `idx_is_read` (`patient_id`, `is_read`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息通知';
