Files
erp_sb/sql/refresh_token.sql
2025-09-22 11:51:16 +08:00

16 lines
865 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 创建刷新令牌表
CREATE TABLE IF NOT EXISTS `refresh_token` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`account_id` bigint(20) NOT NULL COMMENT '账号ID',
`device_id` varchar(100) DEFAULT NULL COMMENT '设备ID',
`token` varchar(255) NOT NULL COMMENT '刷新令牌',
`expire_time` datetime NOT NULL COMMENT '过期时间',
`revoked` char(1) NOT NULL DEFAULT '0' COMMENT '是否已撤销0正常 1撤销',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_token` (`token`),
KEY `idx_account_id` (`account_id`),
KEY `idx_device_id` (`device_id`),
KEY `idx_expire_time` (`expire_time`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='刷新令牌表';