Skip to content

Commit 301bb83

Browse files
committed
增加了SQL案例
1 parent b2d309c commit 301bb83

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

Day36-40/code/app_store.sql

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
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+
unique key `idx_app_id` (`app_id`)
32+
) engine=innodb default charset=utf8 comment='App扩展信息表';
33+
34+
create table `app_category` (
35+
`id` bigint(20) not null auto_increment comment '自增id',
36+
`parent_id` bigint(20) not null default '0' comment '父分类id',
37+
`name` varchar(64) not null default '' comment '分类名称',
38+
`icon` varchar(512) not null default '' comment 'icon地址',
39+
`category_desc` text comment '分类描述',
40+
`category_level` tinyint(4) unsigned not null default '0' comment '分类级别',
41+
`status` tinyint(4) unsigned not null default '0' comment '当前状态,1:使用中,隐藏',
42+
`display_order` int(10) unsigned not null default '0' comment '排序,值越大越靠前',
43+
`create_time` int(10) not null default 0 comment '创建时间',
44+
`update_time` int(10) not null default 0 comment '更新时间',
45+
primary key (`id`)
46+
) engine=innodb default charset=utf8 comment='分类信息表';
47+
48+
create table `app_category_rel` (
49+
`id` bigint(20) not null auto_increment comment '自增id',
50+
`app_id` bigint(20) not null default '0' comment 'app_id',
51+
`category_id` bigint(20) unsigned not null default '0' comment '最低层分类id',
52+
primary key (`id`),
53+
unique key `idx_category_app` (`category_id`,`app_record_id`),
54+
key `idx_app` (`app_id`)
55+
) engine=innodb default charset=utf8 comment='App和分类关联表';
56+
57+
create table `app_comment` (
58+
`id` bigint(20) not null auto_increment comment '自增id',
59+
`app_id` bigint(20) not null default '0' comment 'app_id',
60+
`title` varchar(255) default '' comment '评论标题',
61+
`content` varchar(2048) default '' comment '评论内容',
62+
`parent_id` bigint(20) default '0' comment '父评论id',
63+
`commenter_uid` bigint(20) default '0' comment '评论用户id',
64+
`commenter_name` varchar(255) default '' comment '评论用户名称',
65+
`commenter_avatar` varchar(255) default '' comment '评论用户头像',
66+
`top_flag` tinyint(4) default '0' comment '是否置顶',
67+
`like_count` int(10) default '0' comment '评论的赞数量',
68+
`status` tinyint(4) default '0' comment '评论状态',
69+
`create_time` int(10) not null default 0 comment '创建时间',
70+
`update_time` int(10) not null default 0 comment '更新时间',
71+
primary key (`id`),
72+
key `idx_app_status` (`app_id`, `status`, `top_flag`)
73+
) engine=innodb default charset=utf8 comment='评论信息表';
74+
75+
create table `user_app_relation` (
76+
`id` bigint(20) not null auto_increment comment '自增id',
77+
`user_id` bigint(20) unsigned not null default '0' comment '用户id',
78+
`app_id` bigint(20) not null default '0' comment 'app_id',
79+
`create_time` int(10) not null default 0 comment '创建时间',
80+
`update_time` int(10) not null default 0 comment '更新时间',
81+
`is_del` tinyint(4) not null default '0' comment '1:删除 0:未删除',
82+
primary key (`id`),
83+
key `idx_user_app` (`user_id`,`app_id`)
84+
) engine=innodb auto_increment=8063 default charset=utf8 comment='用户购买关系表';
85+
86+
create table `bot_score` (
87+
`id` bigint(20) not null auto_increment comment '自增id',
88+
`app_id` bigint(20) not null default '0' comment 'app_id',
89+
`score` int(10) default '0' comment '用户评分',
90+
`commenter_uid` bigint(20) default '0' comment '评分用户id',
91+
`status` tinyint(4) default '0' comment '评分状态',
92+
`create_time` int(10) not null default 0 comment '创建时间',
93+
`update_time` int(10) not null default 0 comment '更新时间',
94+
primary key (`id`),
95+
unique key `idx_uid_score` (`app_id`,`commenter_uid`)
96+
) engine=innodb default charset=utf8 comment='App评分表';

0 commit comments

Comments
 (0)