structure.php
13.3 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<?php
/**
* 应用的数据表结构文件
* structure.php
* $Author$
*/
return "
CREATE TABLE IF NOT EXISTS `oa_news_article` (
`article_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`data_id` char(32) NOT NULL DEFAULT '' COMMENT '数据标识',
`class_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '分类ID',
`class_name` varchar(50) NOT NULL DEFAULT '' COMMENT '分类名称',
`title` varchar(64) NOT NULL DEFAULT '' COMMENT '标题',
`ea_id` varchar(32) NOT NULL DEFAULT '' COMMENT '管理员ID',
`ea_name` varchar(50) NOT NULL DEFAULT '' COMMENT '管理员姓名',
`author` varchar(50) NOT NULL DEFAULT '' COMMENT '作者',
`content` mediumtext NOT NULL COMMENT '新闻内容',
`summary` varchar(120) NOT NULL DEFAULT '' COMMENT '摘要',
`cover_id` varchar(32) NOT NULL DEFAULT '' COMMENT '封面图片ID',
`cover_url` varchar(500) NOT NULL DEFAULT '' COMMENT '封面图片URL',
`is_show_cover` tinyint(1) NOT NULL DEFAULT '2' COMMENT '是否正文显示封面图片(1=不显示,2=显示)',
`link` varchar(500) NOT NULL DEFAULT '' COMMENT '外部链接',
`is_jump` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否直接跳转外链(1=不直接跳转,2=直接跳转)',
`is_download` tinyint(1) NOT NULL DEFAULT '1' COMMENT '附件是否支持下载(1=不支持,2=支持)',
`is_secret` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否保密(1=不保密,2=保密)',
`is_share` tinyint(1) NOT NULL DEFAULT '1' COMMENT '允许分享(1=不允许,2=允许)',
`is_notice` tinyint(1) NOT NULL DEFAULT '2' COMMENT '消息通知(1=不开启,2=开启)',
`is_comment` tinyint(1) NOT NULL DEFAULT '2' COMMENT '评论功能(1=不开启,2=开启)',
`comment_anonymous` TINYINT(3) NOT NULL DEFAULT '1' COMMENT '是否开启匿名评论(1=否,2=是)',
`is_like` tinyint(1) NOT NULL DEFAULT '2' COMMENT '点赞功能(1=不开启,2=开启)',
`is_recommend` tinyint(1) NOT NULL DEFAULT '2' COMMENT '首页推荐(1=不开启,2=开启)',
`send_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '发送时间',
`top_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '置顶时间(0为未置顶)',
`update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '未读人数更新时间',
`read_total` int(10) NOT NULL DEFAULT '0' COMMENT '已阅读总数',
`unread_total` int(10) NOT NULL DEFAULT '0' COMMENT '未阅读总数',
`comment_total` int(10) NOT NULL DEFAULT '0' COMMENT '评论总数',
`like_total` int(10) NOT NULL DEFAULT '0' COMMENT '点赞数总数',
`strategy_setting` tinyint(1) NOT NULL DEFAULT '2' COMMENT '积分策略设置(1=启用默认策略;2=不启用策略;3=自定义策略)',
`strategys` text NOT NULL COMMENT '自定义策略数据',
`credit_strategy_setting` tinyint(1) NOT NULL DEFAULT '2' COMMENT '学分策略设置(1=启用默认策略;2=不启用策略;3=自定义策略)',
`credit_strategys` text NOT NULL COMMENT '自定义学分策略数据(序列化)',
`news_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '新闻状态(1=草稿,2=已发布,3=预发布,4=定时发布)',
`cron_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '定时发布时间',
`release_crid` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '定时发布任务id',
`convert_status` int(11) NOT NULL DEFAULT '1' COMMENT '转码状态(1=转码中,2=转码成功,3=转码失败)',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`article_id`),
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `class_id` (`class_id`) USING BTREE,
KEY `send_time` (`send_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='新闻';
CREATE TABLE IF NOT EXISTS `oa_news_attach` (
`attach_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`article_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新闻ID',
`at_id` varchar(32) NOT NULL DEFAULT '' COMMENT '附件ID',
`at_name` varchar(200) NOT NULL DEFAULT '' COMMENT '附件名称',
`at_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '附件类型(1=视频;2=音频;3=其它)',
`at_time` int(10) NOT NULL DEFAULT '0' COMMENT '音、视频播放时长(毫秒)',
`at_size` int(10) NOT NULL DEFAULT '0' COMMENT '附件尺寸(单位字节)',
`at_url` varchar(500) NOT NULL DEFAULT '' COMMENT '附件URL',
`at_convert_url` varchar(500) NOT NULL DEFAULT '' COMMENT '附件转换后的Url',
`at_cover_url` varchar(500) NOT NULL DEFAULT '' COMMENT '视频封面地址',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`attach_id`),
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `article_id` (`article_id`) USING BTREE,
KEY `at_id` (`at_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='附件';
CREATE TABLE IF NOT EXISTS `oa_news_class` (
`class_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID',
`class_name` varchar(20) NOT NULL DEFAULT '' COMMENT '分类名称',
`description` varchar(120) NOT NULL DEFAULT '' COMMENT '分类描述',
`is_open` tinyint(1) NOT NULL DEFAULT '0' COMMENT '启用分类(1=禁用,2=启用)',
`order` int(10) NOT NULL DEFAULT '9999' COMMENT '排序',
`domain` varchar(32) NOT NULL COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`class_id`),
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `parent_id` (`parent_id`) USING BTREE,
KEY `is_open` (`is_open`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='新闻分类';
CREATE TABLE IF NOT EXISTS `oa_news_like` (
`like_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`article_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新闻ID',
`uid` varchar(32) NOT NULL DEFAULT '' COMMENT '用户ID',
`username` varchar(50) NOT NULL DEFAULT '' COMMENT '用户姓名',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`like_id`),
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `article_id` (`article_id`) USING BTREE,
KEY `uid` (`uid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='新闻点赞';
CREATE TABLE IF NOT EXISTS `oa_news_read` (
`read_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`article_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新闻ID',
`uid` varchar(32) NOT NULL DEFAULT '' COMMENT '用户ID',
`username` varchar(50) NOT NULL DEFAULT '' COMMENT '用户姓名',
`dp_name` text NOT NULL COMMENT '所属部门',
`job` varchar(50) NOT NULL DEFAULT '' COMMENT '职位',
`mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`read_id`),
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `article_id` (`article_id`) USING BTREE,
KEY `uid` (`uid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='新闻阅读';
CREATE TABLE IF NOT EXISTS `oa_news_right` (
`right_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`class_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '分类ID',
`article_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新闻ID',
`obj_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '权限类型(1=全公司;2=部门;3=标签;4=人员;5=职位;6=角色)',
`obj_id` varchar(32) NOT NULL DEFAULT '' COMMENT '部门ID、标签ID、人员ID',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`right_id`),
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `class_id` (`class_id`) USING BTREE,
KEY `article_id` (`article_id`) USING BTREE,
KEY `obj_type` (`obj_type`) USING BTREE,
KEY `obj_id` (`obj_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='权限';
CREATE TABLE IF NOT EXISTS `oa_news_setting` (
`setting_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`key` varchar(255) NOT NULL DEFAULT '' COMMENT '变量名',
`value` text NOT NULL COMMENT '变量值',
`type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '缓存类型:0=非数组; 1=数组',
`comment` text NOT NULL COMMENT '说明',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`setting_id`),
KEY `key` (`key`) USING BTREE,
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统配置';
CREATE TABLE IF NOT EXISTS `oa_news_syscache` (
`syscache_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键自增id',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '缓存文件名',
`type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '缓存类型:0=非数组,1=数组',
`data` mediumblob NOT NULL COMMENT '数据',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`syscache_id`),
KEY `name` (`name`) USING BTREE,
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='系统缓存';
CREATE TABLE IF NOT EXISTS `oa_news_task` (
`task_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`article_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新闻ID',
`cron_id` varchar(32) NOT NULL DEFAULT '' COMMENT 'UC计划任务ID',
`domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态:1=新创建;2=已更新;3=已删除',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`task_id`),
KEY `domain` (`domain`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `article_id` (`article_id`) USING BTREE,
KEY `cron_id` (`cron_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='新闻阅读';
CREATE TABLE IF NOT EXISTS `oa_news_user_action` (
`user_action_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`uid` char(32) NOT NULL DEFAULT '' COMMENT '用户ID',
`data_id` int(10) NOT NULL DEFAULT '0' COMMENT '数据ID',
`action_key` varchar(50) NOT NULL DEFAULT '' COMMENT '动作Key',
`domain` char(32) NOT NULL DEFAULT '' COMMENT '企业域名',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '数据状态(1=新创建;2=已更新;3=已删除)',
`created` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`updated` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
`deleted` bigint(20) NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`user_action_id`),
KEY `uid` (`uid`,`action_key`,`data_id`),
KEY `domain` (`domain`),
KEY `status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='用户动作表';
";