app_store.sql 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. create table `app_info` (
  2. `id` bigint(20) not null auto_increment comment '自增id, app的id',
  3. `app_name` varchar(255) default '' comment '名称',
  4. `icon_url` varchar(255) default '' comment 'icon地址',
  5. `version` varchar(32) default '' comment '版本号',
  6. `app_size` varchar(32) default '' comment '包大小',
  7. `banner_info` varchar(4096) default '' comment 'banner信息',
  8. `developer_id` varchar(255) default '' comment '开发者id',
  9. `summary` varchar(512) default '' comment '简介',
  10. `app_desc` text comment '详细信息',
  11. `download_url` varchar(255) default '' comment '下载链接',
  12. `price` int(10) default '0' comment '价格,单位:分',
  13. `status` tinyint(4) unsigned default '0' comment '状态,1:待审核,2:审核通过,3,已下线',
  14. `version_desc` varchar(4096) default '' comment '',
  15. `create_time` datetime not null default '0000-00-00 00:00:00' comment '创建时间',
  16. `update_time` datetime not null default '0000-00-00 00:00:00' comment '更新时间',
  17. primary key (`id`),
  18. key `idx_app_name` (`app_name`),
  19. key `idx_developer` (`user_id`)
  20. ) engine=innodb auto_increment=100000 default charset=utf8 comment='app基本信息表';
  21. create table `app_ext_info` (
  22. `id` bigint(20) not null auto_increment comment '自增id',
  23. `app_id` bigint(20) not null default '0' comment 'app_id',
  24. `install_count` bigint(20) unsigned not null default '0' comment 'app安装量',
  25. `score` int(10) unsigned not null default '0' comment '评分',
  26. `comment_count` int(10) unsigned not null default '0' comment '评论量',
  27. `create_time` int(10) not null default 0 comment '创建时间',
  28. `update_time` int(10) not null default 0 comment '更新时间',
  29. primary key (`id`),
  30. unique key `idx_app_id` (`app_id`)
  31. ) engine=innodb default charset=utf8 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=utf8 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. key `idx_app` (`app_id`)
  52. ) engine=innodb default charset=utf8 comment='App和分类关联表';
  53. create table `app_comment` (
  54. `id` bigint(20) not null auto_increment comment '自增id',
  55. `app_id` bigint(20) not null default '0' comment 'app_id',
  56. `title` varchar(255) default '' comment '评论标题',
  57. `content` varchar(2048) default '' comment '评论内容',
  58. `parent_id` bigint(20) default '0' comment '父评论id',
  59. `commenter_uid` bigint(20) default '0' comment '评论用户id',
  60. `commenter_name` varchar(255) default '' comment '评论用户名称',
  61. `commenter_avatar` varchar(255) default '' comment '评论用户头像',
  62. `top_flag` tinyint(4) default '0' comment '是否置顶',
  63. `like_count` int(10) default '0' comment '评论的赞数量',
  64. `status` tinyint(4) default '0' comment '评论状态',
  65. `create_time` int(10) not null default 0 comment '创建时间',
  66. `update_time` int(10) not null default 0 comment '更新时间',
  67. primary key (`id`),
  68. key `idx_app_status` (`app_id`, `status`, `top_flag`)
  69. ) engine=innodb default charset=utf8 comment='评论信息表';
  70. create table `user_app_relation` (
  71. `id` bigint(20) not null auto_increment comment '自增id',
  72. `user_id` bigint(20) unsigned not null default '0' comment '用户id',
  73. `app_id` bigint(20) not null default '0' comment 'app_id',
  74. `create_time` int(10) not null default 0 comment '创建时间',
  75. `update_time` int(10) not null default 0 comment '更新时间',
  76. `is_del` tinyint(4) not null default '0' comment '1:删除 0:未删除',
  77. primary key (`id`),
  78. key `idx_user_app` (`user_id`,`app_id`)
  79. ) engine=innodb auto_increment=8063 default charset=utf8 comment='用户购买关系表';
  80. create table `bot_score` (
  81. `id` bigint(20) not null auto_increment comment '自增id',
  82. `app_id` bigint(20) not null default '0' comment 'app_id',
  83. `score` int(10) default '0' comment '用户评分',
  84. `commenter_uid` bigint(20) default '0' comment '评分用户id',
  85. `status` tinyint(4) default '0' comment '评分状态',
  86. `create_time` int(10) not null default 0 comment '创建时间',
  87. `update_time` int(10) not null default 0 comment '更新时间',
  88. primary key (`id`),
  89. unique key `idx_uid_score` (`app_id`,`commenter_uid`)
  90. ) engine=innodb default charset=utf8 comment='App评分表';