repair_lite.sql 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*==============================================================*/
  2. /* DBMS name: MySQL 5.0 */
  3. /* Created on: 2019/2/28 11:14:22 */
  4. /*==============================================================*/
  5. drop table if exists permission;
  6. drop table if exists user;
  7. /*==============================================================*/
  8. /* Table: permission */
  9. /*==============================================================*/
  10. create table permission
  11. (
  12. id int not null auto_increment,
  13. uid int not null comment '用户id',
  14. role int comment '用户的角色,设值为1,2,4,8,16...',
  15. create_time timestamp(13) default CURRENT_TIMESTAMP comment '创建时间',
  16. modify_time timestamp(13) default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '最后更新时间',
  17. status char(32) comment '角色是否生效的状态',
  18. is_del bool default false comment '删除标志',
  19. primary key (id)
  20. );
  21. alter table permission comment '权限表';
  22. /*==============================================================*/
  23. /* Table: user */
  24. /*==============================================================*/
  25. create table user
  26. (
  27. id int not null auto_increment,
  28. username varchar(128) not null comment '用户名',
  29. password varchar(128) not null comment '用户密码',
  30. nickname varchar(256) comment '用户昵称',
  31. tel char(16) comment '用户电话',
  32. email char(64) comment '用户邮箱',
  33. create_time timestamp(13) default CURRENT_TIMESTAMP comment '创建时间',
  34. modify_time timestamp(13) default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '最后更新时间',
  35. is_del char(10) default 'false' comment '删除标志',
  36. primary key (id)
  37. );
  38. alter table user comment '用户表';