app_store.sql 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. drop database if exists `app_store`;
  2. create database `app_store` default character set utf8mb4;
  3. use `app_store`;
  4. create table `app_info` (
  5. `id` bigint(20) not null auto_increment comment '自增id, app的id',
  6. `app_name` varchar(255) default '' comment '名称',
  7. `icon_url` varchar(255) default '' comment 'icon地址',
  8. `version` varchar(32) default '' comment '版本号',
  9. `app_size` varchar(32) default '' comment '包大小',
  10. `banner_info` varchar(4096) default '' comment 'banner信息',
  11. `developer_id` varchar(255) default '' comment '开发者id',
  12. `summary` varchar(512) default '' comment '简介',
  13. `app_desc` text comment '详细信息',
  14. `download_url` varchar(255) default '' comment '下载链接',
  15. `price` int(10) default '0' comment '价格,单位:分',
  16. `status` tinyint(4) unsigned default '0' comment '状态,1:待审核,2:审核通过,3,已下线',
  17. `version_desc` varchar(4096) default '' comment '',
  18. `create_time` datetime not null default '0000-00-00 00:00:00' comment '创建时间',
  19. `update_time` datetime not null default '0000-00-00 00:00:00' comment '更新时间',
  20. primary key (`id`)
  21. ) engine=innodb auto_increment=100000 default charset=utf8mb4 comment='app基本信息表';
  22. create table `app_ext_info` (
  23. `id` bigint(20) not null auto_increment comment '自增id',
  24. `app_id` bigint(20) not null default '0' comment 'app_id',
  25. `install_count` bigint(20) unsigned not null default '0' comment 'app安装量',
  26. `score` int(10) unsigned not null default '0' comment '评分',
  27. `comment_count` int(10) unsigned not null default '0' comment '评论量',
  28. `create_time` int(10) not null default 0 comment '创建时间',
  29. `update_time` int(10) not null default 0 comment '更新时间',
  30. primary key (`id`)
  31. ) engine=innodb default charset=utf8mb4 comment='App扩展信息表';
  32. create table `app_category` (
  33. `id` bigint(20) not null auto_increment comment '自增id',
  34. `parent_id` bigint(20) not null default '0' comment '父分类id',
  35. `name` varchar(64) not null default '' comment '分类名称',
  36. `icon` varchar(512) not null default '' comment 'icon地址',
  37. `category_desc` text comment '分类描述',
  38. `category_level` tinyint(4) unsigned not null default '0' comment '分类级别',
  39. `status` tinyint(4) unsigned not null default '0' comment '当前状态,1:使用中,隐藏',
  40. `display_order` int(10) unsigned not null default '0' comment '排序,值越大越靠前',
  41. `create_time` int(10) not null default 0 comment '创建时间',
  42. `update_time` int(10) not null default 0 comment '更新时间',
  43. primary key (`id`)
  44. ) engine=innodb default charset=utf8mb4 comment='分类信息表';
  45. create table `app_category_rel` (
  46. `id` bigint(20) not null auto_increment comment '自增id',
  47. `app_id` bigint(20) not null default '0' comment 'app_id',
  48. `category_id` bigint(20) unsigned not null default '0' comment '最低层分类id',
  49. primary key (`id`),
  50. unique key `idx_category_app` (`category_id`,`app_record_id`),
  51. ) engine=innodb default charset=utf8mb4 comment='App和分类关联表';
  52. create table `app_comment` (
  53. `id` bigint(20) not null auto_increment comment '自增id',
  54. `app_id` bigint(20) not null default '0' comment 'app_id',
  55. `title` varchar(255) default '' comment '评论标题',
  56. `content` varchar(2048) default '' comment '评论内容',
  57. `parent_id` bigint(20) default '0' comment '父评论id',
  58. `commenter_uid` bigint(20) default '0' comment '评论用户id',
  59. `commenter_name` varchar(255) default '' comment '评论用户名称',
  60. `commenter_avatar` varchar(255) default '' comment '评论用户头像',
  61. `top_flag` tinyint(4) default '0' comment '是否置顶',
  62. `like_count` int(10) default '0' comment '评论的赞数量',
  63. `status` tinyint(4) default '0' comment '评论状态',
  64. `create_time` int(10) not null default 0 comment '创建时间',
  65. `update_time` int(10) not null default 0 comment '更新时间',
  66. primary key (`id`),
  67. key `idx_app_status` (`app_id`, `status`, `top_flag`)
  68. ) engine=innodb default charset=utf8mb4 comment='评论信息表';
  69. create table `user_app_relation` (
  70. `id` bigint(20) not null auto_increment comment '自增id',
  71. `user_id` bigint(20) unsigned not null default '0' comment '用户id',
  72. `app_id` bigint(20) not null default '0' comment 'app_id',
  73. `create_time` int(10) not null default 0 comment '创建时间',
  74. `update_time` int(10) not null default 0 comment '更新时间',
  75. `is_del` tinyint(4) not null default '0' comment '1:删除 0:未删除',
  76. primary key (`id`),
  77. key `idx_user_app` (`user_id`,`app_id`)
  78. ) engine=innodb auto_increment=8063 default charset=utf8mb4 comment='用户购买关系表';
  79. create table `bot_score` (
  80. `id` bigint(20) not null auto_increment comment '自增id',
  81. `app_id` bigint(20) not null default '0' comment 'app_id',
  82. `score` int(10) default '0' comment '用户评分',
  83. `commenter_uid` bigint(20) default '0' comment '评分用户id',
  84. `status` tinyint(4) default '0' comment '评分状态',
  85. `create_time` int(10) not null default 0 comment '创建时间',
  86. `update_time` int(10) not null default 0 comment '更新时间',
  87. primary key (`id`),
  88. unique key `idx_uid_score` (`app_id`,`commenter_uid`)
  89. ) engine=innodb default charset=utf8mb4 comment='App评分表';