-- 表: auth_token

DROP TABLE IF EXISTS `auth_token`;
CREATE TABLE `auth_token` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `device_id` varchar(255) DEFAULT NULL COMMENT '设备ID',
  `domain` varchar(255) NOT NULL DEFAULT '',
  `auth_code` varchar(255) DEFAULT NULL COMMENT '授权码',
  `token` text COMMENT 'JWT令牌',
  `refresh_token` text COMMENT '刷新令牌',
  `expires_at` datetime NOT NULL,
  `is_trial` tinyint(1) DEFAULT '1' COMMENT '是否试用',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `domain` (`domain`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='授权令牌表';
