DROP TABLE IF EXISTS `qr_login`;
CREATE TABLE `qr_login` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `qr_token` varchar(64) NOT NULL COMMENT '二维码token',
  `code` varchar(6) NOT NULL COMMENT '6位验证码',
  `status` enum('pending','verified','expired') DEFAULT 'pending' COMMENT '状态',
  `user_id` int(11) DEFAULT '0' COMMENT '用户ID',
  `user_name` varchar(50) DEFAULT '' COMMENT '用户名',
  `create_time` datetime DEFAULT NULL,
  `expire_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `qr_token` (`qr_token`),
  KEY `code` (`code`),
  KEY `status` (`status`),
  KEY `expire_time` (`expire_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='扫码登录表';