structure.php
11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
/**
* 应用的数据表结构文件
* structure.php
* $Author$
*/
return "
CREATE TABLE IF NOT EXISTS `oa_activity_activity` (
`ac_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`activity_type` tinyint(3) NOT NULL DEFAULT '1' COMMENT '活动状态 1=常规,2=任务',
`subject` varchar(120) NOT NULL DEFAULT '' COMMENT '活动主题',
`source` varchar(50) NOT NULL DEFAULT '' COMMENT '作者与来源',
`cover_id` char(32) NOT NULL DEFAULT '' COMMENT '封面图片 ID',
`begin_time` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '活动开始时间',
`end_time` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '活动结束时间',
`content` MEDIUMTEXT NOT NULL COMMENT '活动描述',
`is_all` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '参与范围是否全公司:0(默认)=否;1=是',
`is_notice` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否发送消息通知:0(默认)=否;1=是',
`is_recomend` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否推荐到首页:0(默认)=否;1=是',
`activity_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '活动状态,0(默认)=草稿,1=发布,2=提前终止',
`likes` int(11) NOT NULL DEFAULT '0' COMMENT '点赞总数量',
`comments` int(11) NOT NULL DEFAULT '0' COMMENT '评论总数量',
`unjoin_total` int(10) NOT NULL DEFAULT '0' COMMENT '已参与人数',
`join_total` int(10) NOT NULL DEFAULT '0' COMMENT '已参与人数',
`publish_time` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '发布时间',
`last_time` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '最后更新活动时间',
`integral_action_type` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '积分策略(1:启用默认,2:不启用,3:启用自定义策略)',
`integral_strategyid` varchar(255) NOT NULL DEFAULT '' COMMENT '积分策略ID集合(逗号分隔)',
`credit_action_type` tinyint(3) NOT NULL DEFAULT '1' COMMENT '学分策略设置(1=启用默认策略;2=不启用策略;3=自定义策略)',
`credit_strategyid` text NOT NULL COMMENT '学分策略ID集合(序列化)',
`floor` int(11) NOT NULL DEFAULT '0' COMMENT '楼层',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`ac_id`),
KEY `domain_status` (`domain`,`status`,`activity_status`),
KEY `activity_type` (`activity_type`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='活动-主表';
CREATE TABLE IF NOT EXISTS `oa_activity_right` (
`right_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`ac_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活动ID',
`uid` char(32) NOT NULL DEFAULT '' COMMENT '人员 ID',
`dp_id` char(32) NOT NULL DEFAULT '' COMMENT '部门 ID',
`tag_id` char(32) NOT NULL DEFAULT '' COMMENT '标签 ID',
`job_id` char(32) NOT NULL DEFAULT '' COMMENT '岗位 ID',
`role_id` char(32) NOT NULL DEFAULT '' COMMENT '角色 ID',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`right_id`),
KEY `domain_status` (`domain`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='活动-权限表';
CREATE TABLE IF NOT EXISTS `oa_activity_comment` (
`comment_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`ac_id` int(10) NOT NULL DEFAULT '0' COMMENT '活动ID',
`parent_id` int(10) NOT NULL DEFAULT '0' COMMENT '评论父ID',
`uid` char(32) NOT NULL DEFAULT '' COMMENT '用户ID',
`content` text NOT NULL COMMENT '评论内容',
`is_attach` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否含有附件图片(0=无,1=有)',
`likes` int(11) NOT NULL DEFAULT '0' COMMENT '点赞总数量',
`replys` int(11) NOT NULL DEFAULT '0' COMMENT '回复总数量',
`top_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '置顶时间',
`sort` int(10) NOT NULL DEFAULT '0' COMMENT '排序',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`comment_id`),
KEY `parent_id` (`parent_id`),
KEY `domain_status` (`domain`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='活动-评论表';
CREATE TABLE IF NOT EXISTS `oa_activity_like` (
`like_id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`uid` char(32) NOT NULL DEFAULT '' COMMENT '点赞人ID',
`cid` int(10) NOT NULL DEFAULT '0' COMMENT '活动、评论ID',
`type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '点赞类型:1:活动、2:评论',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`like_id`),
KEY `cid` (`cid`),
KEY `domain_status` (`domain`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='活动-点赞表';
CREATE TABLE IF NOT EXISTS `oa_activity_attachment` (
`attach_id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`cid` int(10) NOT NULL DEFAULT '0' COMMENT '评论ID',
`at_id` char(32) NOT NULL DEFAULT '' COMMENT 'UC返回的图片ID',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`attach_id`),
KEY `cid` (`cid`),
KEY `domain_status` (`domain`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='活动-评论附件表';
CREATE TABLE IF NOT EXISTS `oa_activity_syscache` (
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '缓存文件名',
`domain` varchar(120) NOT NULL DEFAULT '' COMMENT '企业域名',
`type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '缓存类型, 0:非数组, 1:数组',
`data` mediumblob NOT NULL COMMENT '数据',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '记录状态, 1初始化,2=已更新, 3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='活动-缓存表';
CREATE TABLE IF NOT EXISTS `oa_activity_setting` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增 ID',
`key` varchar(255) NOT NULL DEFAULT '' COMMENT '变量名',
`value` text NOT NULL COMMENT '值',
`type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '缓存类型, 0:非数组, 1:数组',
`comment` text NOT NULL COMMENT '说明',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`id`),
KEY `domain_status` (`domain`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='活动-设置表';
CREATE TABLE IF NOT EXISTS `oa_activity_count` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`uid` char(32) NOT NULL DEFAULT '' COMMENT '用户ID',
`replies_total` int(10) NOT NULL DEFAULT '0' COMMENT '回帖被回复次数',
`replies_num` int(10) NOT NULL DEFAULT '0' COMMENT '回帖被回复个数',
`reply_total` int(10) NOT NULL DEFAULT '0' COMMENT '回帖次数',
`reply_num` int(10) NOT NULL DEFAULT '0' COMMENT '回复活动数',
`answer_total` int(10) NOT NULL DEFAULT '0' COMMENT '回复次数',
`answer_num` int(10) NOT NULL DEFAULT '0' COMMENT '回复回帖个数',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
KEY `domain_status` (`domain`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='活动回复,被回复统计信息表';
CREATE TABLE IF NOT EXISTS `oa_activity_log` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`uid` char(32) NOT NULL DEFAULT '' COMMENT '用户ID',
`pid` int(10) NOT NULL DEFAULT '0' COMMENT '帖子ID',
`businessId` varchar(32) NOT NULL DEFAULT '' COMMENT '业务ID',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
KEY `businessId` (`businessId`),
KEY `domain_status` (`domain`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='活动积分日志表';
CREATE TABLE IF NOT EXISTS `oa_activity_history` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`uid` char(32) NOT NULL DEFAULT '' COMMENT '用户ID',
`ac_id` int(10) NOT NULL DEFAULT '0' COMMENT '话题ID',
`pid` int(10) NOT NULL DEFAULT '0' COMMENT '帖子ID',
`type` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '回复类型, 1:回复活动类型, 2:回帖被回复,3.被回复帖子',
`post_man` char(32) NOT NULL DEFAULT '' COMMENT '回帖人UID',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除',
`created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
KEY `post_man` (`post_man`),
KEY `pid` (`pid`),
KEY `domain_status` (`domain`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='同事圈话题被回复,回复话题日志表';
";