-- 表: notifications

DROP TABLE IF EXISTS `notifications`;
CREATE TABLE `notifications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL COMMENT '用户ID',
  `type` varchar(50) NOT NULL DEFAULT '',
  `category` varchar(50) DEFAULT 'general',
  `target_type` varchar(50) NOT NULL DEFAULT 'all',
  `target_bt` int(11) NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `content` text,
  `is_read` tinyint(1) DEFAULT '0' COMMENT '是否已读：0未读，1已读',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：0未删除，1已删除',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_is_read` (`is_read`),
  KEY `idx_is_deleted` (`is_deleted`),
  KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='站内消息通知表';
