-
Notifications
You must be signed in to change notification settings - Fork 5
/
schema.sql
241 lines (197 loc) · 6.27 KB
/
schema.sql
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `blogcomments` (
`id` int(11) NOT NULL auto_increment,
`toid` int(11) NOT NULL,
`author` varchar(255) NOT NULL,
`text` varchar(500) NOT NULL,
`date` datetime NOT NULL,
`parent_id` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `blogs`
--
CREATE TABLE IF NOT EXISTS `blogs` (
`id` int(11) NOT NULL auto_increment,
`text` text NOT NULL,
`author` varchar(255) NOT NULL,
`date` datetime NOT NULL,
`title` varchar(255) NOT NULL,
`category` int(11) NOT NULL,
`privacy_level` int(11) NOT NULL,
`pinned` tinyint(1) NOT NULL default '0',
`kudos` int(11) default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bulletincomments`
--
CREATE TABLE IF NOT EXISTS `bulletincomments` (
`id` int(11) NOT NULL auto_increment,
`toid` int(11) NOT NULL,
`author` varchar(255) NOT NULL,
`text` varchar(500) NOT NULL,
`date` datetime NOT NULL,
`parent_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bulletins`
--
CREATE TABLE IF NOT EXISTS `bulletins` (
`id` int(11) NOT NULL auto_increment,
`text` text NOT NULL,
`author` varchar(255) NOT NULL,
`date` datetime NOT NULL,
`title` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE IF NOT EXISTS `comments` (
`id` int(11) NOT NULL auto_increment,
`toid` int(11) NOT NULL,
`author` varchar(255) NOT NULL,
`text` varchar(500) NOT NULL,
`date` datetime NOT NULL,
`parent_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `favorites`
--
CREATE TABLE IF NOT EXISTS `favorites` (
`user_id` int(11) NOT NULL,
`favorites` text,
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `friends`
--
CREATE TABLE IF NOT EXISTS `friends` (
`id` int(11) NOT NULL auto_increment,
`sender` varchar(255) NOT NULL,
`receiver` varchar(255) NOT NULL,
`status` varchar(255) NOT NULL default 'PENDING',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `groupcomments`
--
CREATE TABLE IF NOT EXISTS `groupcomments` (
`id` int(11) NOT NULL auto_increment,
`toid` int(11) NOT NULL,
`author` varchar(255) NOT NULL,
`text` varchar(500) NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
CREATE TABLE IF NOT EXISTS `groups` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`description` varchar(500) NOT NULL,
`author` varchar(255) NOT NULL,
`date` datetime NOT NULL,
`members` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `layoutcomments`
--
CREATE TABLE IF NOT EXISTS `layoutcomments` (
`id` int(11) NOT NULL auto_increment,
`toid` int(11) NOT NULL,
`author` varchar(255) NOT NULL,
`text` varchar(500) NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `layouts`
--
CREATE TABLE IF NOT EXISTS `layouts` (
`id` int(11) NOT NULL auto_increment,
`text` text NOT NULL,
`author` varchar(255) NOT NULL,
`date` datetime NOT NULL,
`title` varchar(255) NOT NULL,
`code` blob NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `messages`
--
CREATE TABLE IF NOT EXISTS `messages` (
`id` int(11) NOT NULL auto_increment,
`toid` int(11) NOT NULL,
`author` int(11) NOT NULL,
`msg` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `reports`
--
CREATE TABLE IF NOT EXISTS `reports` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL,
`creator_id` int(11) NOT NULL,
`date` datetime NOT NULL,
`content_type` int(11) NOT NULL,
`content_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `sessions`
--
CREATE TABLE IF NOT EXISTS `sessions` (
`id` int(11) NOT NULL auto_increment,
`session_id` varchar(16) NOT NULL,
`user_id` int(11) NOT NULL,
`user` varchar(50) NOT NULL,
`last_logon` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`last_activity` timestamp NOT NULL default '0000-00-00 00:00:00',
`active` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL auto_increment,
`rank` tinyint(4) NOT NULL default '0',
`username` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`date` datetime NOT NULL,
`bio` varchar(500) NOT NULL default '',
`interests` varchar(500) NOT NULL default ' ',
`css` blob NOT NULL,
`music` varchar(255) NOT NULL default 'default.mp3',
`pfp` varchar(255) NOT NULL default 'default.jpg',
`currentgroup` varchar(255) NOT NULL default 'None',
`status` varchar(255) NOT NULL default '',
`private` tinyint(1) NOT NULL default '0',
`views` int(11) NOT NULL default '0',
`lastactive` datetime NOT NULL,
`lastlogon` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;