Commit 121ad85abfc9a46907540398517d3ec01c56a13e
1 parent
57350a97
[留言板]模块表结构
Showing
1 changed file
with
131 additions
and
0 deletions
trunk/Message/Common/Sql/structure.php
0 → 100644
1 | +<?php | ||
2 | +// 应用的数据表结构文件 sql | ||
3 | +return " | ||
4 | +CREATE TABLE IF NOT EXISTS `zx_message_person`( | ||
5 | + `person_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', | ||
6 | + `name` varchar(15) NOT NULL DEFAULT '' COMMENT '姓名', | ||
7 | + `pwd` varchar(32) NOT NULL DEFAULT '' COMMENT '密码', | ||
8 | + `sex` tinyint(3) NOT NULL DEFAULT '2' COMMENT '性别 1 女 2 男', | ||
9 | + `mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号码', | ||
10 | + `email` varchar(64) NOT NULL DEFAULT '' COMMENT '邮箱', | ||
11 | + `domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名', | ||
12 | + `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '记录状态, 1=正常,2=冻结, 3=删除', | ||
13 | + `created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', | ||
14 | + `updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', | ||
15 | + `deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', | ||
16 | + PRIMARY KEY(`person_id`), | ||
17 | + INDEX(`sex`), | ||
18 | + INDEX(`domain`), | ||
19 | + INDEX(`status`), | ||
20 | + INDEX(`created`), | ||
21 | + INDEX(`updated`), | ||
22 | + INDEX(`deleted`) | ||
23 | +)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言板-留言者信息表'; | ||
24 | + | ||
25 | +--留言信息表 | ||
26 | +CREATE TABLE IF NOT EXISTS `zx_message_message`( | ||
27 | + `message_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', | ||
28 | + `title` varchar(80) NOT NULL DEFAULT '' COMMENT '留言标题', | ||
29 | + `message` varchar(500) NOT NULL DEFAULT '' COMMENT '留言内容', | ||
30 | + `ip` varchar(15) NOT NULL DEFAULT '' COMMENT '留言ip', | ||
31 | + `uid` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '操作用户id', | ||
32 | + `attachment` text NOT NULL COMMENT '素材id,多个使用逗号分隔', | ||
33 | + `receiver_uid` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '接收留言的用户id', | ||
34 | + `checked` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '审核状态, 1=未审核,2=通过, 3=不通过', | ||
35 | + `domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名', | ||
36 | + `status` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '状态, 1=初始化,2=已更新,3=已删除', | ||
37 | + `created` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间', | ||
38 | + `updated` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间', | ||
39 | + `deleted` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '删除时间', | ||
40 | + PRIMARY KEY(message_id), | ||
41 | + INDEX(`domain`), | ||
42 | + INDEX(`status`), | ||
43 | + INDEX(`uid`), | ||
44 | + INDEX(`created`), | ||
45 | + INDEX(`updated`), | ||
46 | + INDEX(`deleted`) | ||
47 | +)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言板-留言信息表'; | ||
48 | + | ||
49 | +-- 留言与评论关联表 | ||
50 | +CREATE TABLE IF NOT EXISTS `zx_message_msg__comment`( | ||
51 | + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', | ||
52 | + `message_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '留言记录id', | ||
53 | + `comment_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '评论记录id', | ||
54 | + `domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名', | ||
55 | + `status` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '状态, 1=初始化,2=已更新,3=已删除', | ||
56 | + `created` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间', | ||
57 | + `updated` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间', | ||
58 | + `deleted` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '删除时间', | ||
59 | + PRIMARY KEY(`id`), | ||
60 | + INDEX(`message_id`), | ||
61 | + INDEX(`comment_id`), | ||
62 | + INDEX(`domain`), | ||
63 | + INDEX(`status`), | ||
64 | + INDEX(`created`), | ||
65 | + INDEX(`updated`), | ||
66 | + INDEX(`deleted`) | ||
67 | +)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言与评论关联表'; | ||
68 | + | ||
69 | +-- 评论表 | ||
70 | +CREATE TABLE IF NOT EXISTS `zx_message_comment`( | ||
71 | + `comment_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', | ||
72 | + `comment` varchar(140) NOT NULL DEFAULT '' COMMENT '评论内容', | ||
73 | + `m_uid` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '操作用户id', | ||
74 | + `domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名', | ||
75 | + `status` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '状态, 1=初始化,2=已更新,3=已删除', | ||
76 | + `created` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间', | ||
77 | + `updated` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间', | ||
78 | + `deleted` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '删除时间', | ||
79 | + PRIMARY KEY(`comment_id`), | ||
80 | + INDEX(`domain`), | ||
81 | + INDEX(`status`), | ||
82 | + INDEX(`m_uid`), | ||
83 | + INDEX(`created`), | ||
84 | + INDEX(`updated`), | ||
85 | + INDEX(`deleted`) | ||
86 | +)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言与评论关联表'; | ||
87 | + | ||
88 | +-- 留言板素材表 | ||
89 | +CREATE TABLE IF NOT EXISTS `zx_message_attachment`( | ||
90 | + `attachment_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', | ||
91 | + `path` varchar(255) NOT NULL DEFAULT '' COMMENT '素材路径', | ||
92 | + `domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名', | ||
93 | + `status` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '状态, 1=初始化,2=已更新,3=已删除', | ||
94 | + `created` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间', | ||
95 | + `updated` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间', | ||
96 | + `deleted` bigint(13) unsigned NOT NULL DEFAULT 0 COMMENT '删除时间', | ||
97 | + PRIMARY KEY(`attachment_id`), | ||
98 | + INDEX(`domain`), | ||
99 | + INDEX(`status`), | ||
100 | + INDEX(`created`), | ||
101 | + INDEX(`updated`), | ||
102 | + INDEX(`deleted`) | ||
103 | +)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言板素材表'; | ||
104 | + | ||
105 | + | ||
106 | +CREATE TABLE IF NOT EXISTS `zx_message_syscache` ( | ||
107 | + `name` varchar(255) NOT NULL COMMENT '缓存文件名', | ||
108 | + `domain` varchar(120) NOT NULL DEFAULT '' COMMENT '企业域名', | ||
109 | + `type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '缓存类型, 0:非数组, 1:数组', | ||
110 | + `data` mediumblob NOT NULL COMMENT '数据', | ||
111 | + `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '记录状态, 1=初始化,2=已更新, 3=已删除', | ||
112 | + `created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', | ||
113 | + `updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', | ||
114 | + `deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间' | ||
115 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言板-缓存表'; | ||
116 | + | ||
117 | +CREATE TABLE IF NOT EXISTS `zx_message_setting` ( | ||
118 | + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增 ID', | ||
119 | + `key` varchar(255) NOT NULL DEFAULT '' COMMENT '变量名', | ||
120 | + `value` text NOT NULL COMMENT '值', | ||
121 | + `type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '缓存类型, 0:非数组, 1:数组', | ||
122 | + `comment` text NOT NULL COMMENT '说明', | ||
123 | + `domain` varchar(32) NOT NULL DEFAULT '' COMMENT '企业域名', | ||
124 | + `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态, 1=初始化,2=已更新,3=已删除', | ||
125 | + `created` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', | ||
126 | + `updated` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', | ||
127 | + `deleted` bigint(13) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', | ||
128 | + PRIMARY KEY (`id`), | ||
129 | + KEY `domain_status` (`domain`,`status`) | ||
130 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='留言板-设置表'; | ||
131 | +"; |