19 lines
1.0 KiB
SQL
19 lines
1.0 KiB
SQL
-- 创建用户表
|
||
CREATE TABLE IF NOT EXISTS `tk_users` (
|
||
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||
`username` varchar(50) NOT NULL COMMENT '用户名',
|
||
`password` varchar(60) NOT NULL COMMENT '密码',
|
||
`mobile` varchar(11) DEFAULT NULL COMMENT '登录手机号',
|
||
`identity_id` int(10) DEFAULT NULL COMMENT '身份信息',
|
||
`auth_id` int(10) DEFAULT NULL COMMENT '权限id',
|
||
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||
`update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||
`delete_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `idx_username` (`username`),
|
||
UNIQUE KEY `idx_mobile` (`mobile`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
|
||
|
||
-- 插入测试数据
|
||
INSERT INTO `tk_users` (`username`, `password`, `mobile`, `identity_id`, `auth_id`) VALUES
|
||
('admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '13800138000', 1, 1); -- 密码为:password |