mysql.sql 993 B

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