mysql.sql 961 B

123456789101112131415161718192021222324
  1. -- 用户表
  2. CREATE TABLE `tb_user` (
  3. `user_id` bigint NOT NULL AUTO_INCREMENT,
  4. `username` varchar(50) NOT NULL COMMENT '用户名',
  5. `mobile` varchar(20) NOT NULL COMMENT '手机号',
  6. `password` varchar(64) COMMENT '密码',
  7. `create_time` datetime COMMENT '创建时间',
  8. PRIMARY KEY (`user_id`),
  9. UNIQUE INDEX (`username`)
  10. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户';
  11. -- 用户Token表
  12. CREATE TABLE `tb_token` (
  13. `user_id` bigint NOT NULL,
  14. `token` varchar(100) NOT NULL COMMENT 'token',
  15. `expire_time` datetime COMMENT '过期时间',
  16. `update_time` datetime COMMENT '更新时间',
  17. PRIMARY KEY (`user_id`),
  18. UNIQUE INDEX (`token`)
  19. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户Token';
  20. -- 账号:13612345678 密码:admin
  21. INSERT INTO `tb_user` (`username`, `mobile`, `password`, `create_time`) VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41');