structure.php
6.76 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
<?php
// 应用的数据表结构文件 sql
return "
CREATE TABLE IF NOT EXISTS `zx_message_person`(
`person_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(15) NOT NULL DEFAULT '' COMMENT '姓名',
`pwd` varchar(32) NOT NULL DEFAULT '' COMMENT '密码',
`sex` tinyint(3) NOT NULL DEFAULT '2' COMMENT '性别 1 女 2 男',
`mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号码',
`email` varchar(64) NOT NULL DEFAULT '' 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(`person_id`),
INDEX(`sex`),
INDEX(`domain`),
INDEX(`status`),
INDEX(`created`),
INDEX(`updated`),
INDEX(`deleted`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言板-留言者信息表';
--留言信息表
CREATE TABLE IF NOT EXISTS `zx_message_message`(
`message_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`title` varchar(80) NOT NULL DEFAULT '' COMMENT '留言标题',
`message` varchar(500) NOT NULL DEFAULT '' COMMENT '留言内容',
`ip` varchar(15) NOT NULL DEFAULT '' COMMENT '留言ip',
`uid` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '操作用户id',
`attachment` text NOT NULL COMMENT '素材id,多个使用逗号分隔',
`receiver_uid` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '接收留言的用户id',
`checked` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '审核状态, 1=未审核,2=通过, 3=不通过',
`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(message_id),
INDEX(`domain`),
INDEX(`status`),
INDEX(`uid`),
INDEX(`created`),
INDEX(`updated`),
INDEX(`deleted`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言板-留言信息表';
-- 留言与评论关联表
CREATE TABLE IF NOT EXISTS `zx_message_msg__comment`(
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`message_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '留言记录id',
`comment_id` int(10) unsigned NOT NULL DEFAULT 0 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`),
INDEX(`message_id`),
INDEX(`comment_id`),
INDEX(`domain`),
INDEX(`status`),
INDEX(`created`),
INDEX(`updated`),
INDEX(`deleted`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言与评论关联表';
-- 评论表
CREATE TABLE IF NOT EXISTS `zx_message_comment`(
`comment_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`comment` varchar(140) NOT NULL DEFAULT '' COMMENT '评论内容',
`m_uid` int(10) unsigned NOT NULL DEFAULT 0 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(`comment_id`),
INDEX(`domain`),
INDEX(`status`),
INDEX(`m_uid`),
INDEX(`created`),
INDEX(`updated`),
INDEX(`deleted`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言与评论关联表';
-- 留言板素材表
CREATE TABLE IF NOT EXISTS `zx_message_attachment`(
`attachment_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`path` varchar(255) NOT NULL DEFAULT '' 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(`attachment_id`),
INDEX(`domain`),
INDEX(`status`),
INDEX(`created`),
INDEX(`updated`),
INDEX(`deleted`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言板素材表';
CREATE TABLE IF NOT EXISTS `zx_message_syscache` (
`name` varchar(255) NOT NULL 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 `zx_message_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='留言板-设置表';
";