install.sql 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. create table config
  2. (
  3. user_id int null,
  4. config json null
  5. );
  6. create table history
  7. (
  8. id bigint auto_increment
  9. primary key,
  10. user_id int null,
  11. link json null,
  12. constraint history_id_uindex
  13. unique (id)
  14. )
  15. comment 'link历史数据';
  16. create table link
  17. (
  18. user_id int null,
  19. link json null
  20. );
  21. create table linkstore
  22. (
  23. id int auto_increment
  24. primary key,
  25. name varchar(20) null,
  26. src varchar(255) null,
  27. url varchar(255) null,
  28. type varchar(20) default 'icon' null,
  29. size varchar(20) default '1x1' null,
  30. create_time datetime null,
  31. hot bigint default 0 null,
  32. area varchar(20) default '综合' null comment '专区',
  33. tips varchar(30) null comment '介绍',
  34. domain varchar(100) null,
  35. app int default 0 null comment '是否app',
  36. install_num int default 0 null comment '安装量',
  37. constraint linkStore_id_uindex
  38. unique (id)
  39. );
  40. create table note
  41. (
  42. id bigint auto_increment
  43. primary key,
  44. user_id bigint null,
  45. title varchar(50) null,
  46. text text null,
  47. create_time datetime null,
  48. update_time datetime null,
  49. constraint note_id_uindex
  50. unique (id)
  51. );
  52. create index note_user_id_index
  53. on note (user_id);
  54. create table setting
  55. (
  56. `keys` varchar(200) not null
  57. primary key,
  58. value text null
  59. );
  60. create table tabbar
  61. (
  62. user_id int null,
  63. tabs json null
  64. )
  65. comment '用户页脚信息';
  66. create table token
  67. (
  68. id bigint auto_increment
  69. primary key,
  70. user_id int null,
  71. token tinytext null,
  72. create_time int null,
  73. ip tinytext null,
  74. user_agent tinytext null,
  75. constraint token_id_uindex
  76. unique (id)
  77. );
  78. create table user
  79. (
  80. id int auto_increment
  81. primary key,
  82. mail varchar(50) null,
  83. password tinytext null,
  84. create_time datetime null,
  85. login_ip varchar(100) null comment '登录IP',
  86. register_ip varchar(100) null comment '注册IP',
  87. manager int default 0 null,
  88. login_fail_count int default 0 null,
  89. login_time datetime null comment '登录时间',
  90. constraint user_id_uindex
  91. unique (id),
  92. constraint user_mail_uindex
  93. unique (mail)
  94. );