-
Notifications
You must be signed in to change notification settings - Fork 27
/
schema.sql
298 lines (270 loc) · 10.1 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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `auth`
--
DROP TABLE IF EXISTS `auth`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `auth` (
`authid` varchar(64) NOT NULL DEFAULT '',
`authkey` varchar(255) NOT NULL DEFAULT '',
`cburl` varchar(255) DEFAULT NULL,
`owneremail` varchar(255) DEFAULT NULL,
PRIMARY KEY (`authid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `commits`
--
DROP TABLE IF EXISTS `commits`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `commits` (
`repo` varchar(100) NOT NULL,
`hash` binary(40) NOT NULL,
UNIQUE KEY `repo` (`repo`,`hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `country`
--
DROP TABLE IF EXISTS `country`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `country` (
`id` char(3) NOT NULL DEFAULT '',
`alpha2` char(2) NOT NULL DEFAULT '',
`name` varchar(255) NOT NULL DEFAULT '',
`lat` int(8) NOT NULL DEFAULT 0,
`lon` int(8) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `mirrors`
--
DROP TABLE IF EXISTS `mirrors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mirrors` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`mirrortype` int(1) NOT NULL DEFAULT 1,
`cc` char(3) NOT NULL DEFAULT '',
`lang` varchar(5) NOT NULL DEFAULT '',
`hostname` varchar(40) NOT NULL DEFAULT '',
`cname` varchar(80) NOT NULL DEFAULT '',
`maintainer` varchar(255) NOT NULL DEFAULT '',
`providername` varchar(255) NOT NULL DEFAULT '',
`providerurl` varchar(255) NOT NULL DEFAULT '',
`has_stats` int(1) NOT NULL DEFAULT 0,
`has_search` int(1) NOT NULL DEFAULT 0,
`active` int(1) NOT NULL DEFAULT 0,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`lastedited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`lastupdated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`lastchecked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`phpversion` varchar(16) NOT NULL DEFAULT '',
`acmt` text DEFAULT NULL,
`ocmt` text DEFAULT NULL,
`maintainer2` varchar(255) NOT NULL DEFAULT '',
`load_balanced` varchar(4) DEFAULT NULL,
`ext_avail` text DEFAULT NULL,
`local_hostname` varchar(255) DEFAULT NULL,
`ipv4_addr` varchar(55) DEFAULT NULL,
`ipv6_addr` varchar(55) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `hostname` (`hostname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `note`
--
DROP TABLE IF EXISTS `note`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `note` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`sect` varchar(80) NOT NULL DEFAULT '',
`user` varchar(80) DEFAULT NULL,
`note` text DEFAULT NULL,
`ts` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(16) DEFAULT NULL,
`lang` varchar(16) DEFAULT NULL,
`votes` int(11) NOT NULL DEFAULT 0,
`rating` int(11) NOT NULL DEFAULT 0,
`updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `idx_sect` (`sect`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 PACK_KEYS=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `phpcal`
--
DROP TABLE IF EXISTS `phpcal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `phpcal` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`sdato` date DEFAULT NULL,
`edato` date DEFAULT NULL,
`recur` varchar(12) DEFAULT NULL,
`sdesc` varchar(32) NOT NULL DEFAULT '',
`url` varchar(128) DEFAULT NULL,
`email` varchar(128) NOT NULL DEFAULT '',
`ldesc` text DEFAULT NULL,
`tipo` int(1) NOT NULL DEFAULT 0,
`approved` int(1) NOT NULL DEFAULT 0,
`app_by` varchar(16) DEFAULT NULL,
`country` char(3) NOT NULL DEFAULT '',
`category` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `sdato` (`sdato`),
KEY `edato` (`edato`),
KEY `country` (`country`),
KEY `category` (`category`),
FULLTEXT KEY `sdesc` (`sdesc`,`ldesc`,`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `sites`
--
DROP TABLE IF EXISTS `sites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sites` (
`cat` varchar(48) NOT NULL DEFAULT '',
`name` varchar(80) NOT NULL DEFAULT '',
`url` varchar(80) NOT NULL DEFAULT '',
`email` varchar(60) NOT NULL DEFAULT '',
`password` varchar(16) NOT NULL DEFAULT '',
`approved` enum('N','Y') NOT NULL DEFAULT 'N',
`approved_by` varchar(20) NOT NULL DEFAULT '',
`note` text DEFAULT NULL,
`ts` datetime DEFAULT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 PACK_KEYS=1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tokens`
--
DROP TABLE IF EXISTS `tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tokens` (
`tokid` varchar(64) NOT NULL DEFAULT '',
`generatedfor` varchar(64) NOT NULL DEFAULT '',
`username` varchar(16) NOT NULL DEFAULT '',
`expires` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`tokid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`userid` int(11) NOT NULL AUTO_INCREMENT,
`svnpasswd` varchar(60) NOT NULL DEFAULT '',
`name` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL DEFAULT '',
`username` varchar(16) DEFAULT NULL,
`cvsaccess` int(1) NOT NULL DEFAULT 0,
`spamprotect` int(1) NOT NULL DEFAULT 1,
`forgot` varchar(32) DEFAULT NULL,
`dns_allow` int(1) NOT NULL DEFAULT 1,
`dns_type` varchar(5) NOT NULL DEFAULT 'NONE',
`dns_target` varchar(255) NOT NULL DEFAULT '',
`last_commit` datetime DEFAULT NULL,
`num_commits` int(11) NOT NULL DEFAULT 0,
`verified` int(1) NOT NULL DEFAULT 0,
`use_sa` int(11) DEFAULT 5,
`greylist` int(11) NOT NULL DEFAULT 0,
`enable` int(1) NOT NULL DEFAULT 0,
`pchanged` int(11) DEFAULT 0,
`ssh_keys` text DEFAULT NULL,
PRIMARY KEY (`userid`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `username` (`username`),
FULLTEXT KEY `name` (`name`,`email`,`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users_cvs`
--
DROP TABLE IF EXISTS `users_cvs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users_cvs` (
`userid` int(11) NOT NULL DEFAULT 0,
`cvsuser` char(16) NOT NULL DEFAULT '',
`approved` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`userid`),
UNIQUE KEY `cvsuser` (`cvsuser`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users_note`
--
DROP TABLE IF EXISTS `users_note`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users_note` (
`noteid` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) NOT NULL DEFAULT 0,
`entered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`note` text DEFAULT NULL,
PRIMARY KEY (`noteid`),
FULLTEXT KEY `note` (`note`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users_profile`
--
DROP TABLE IF EXISTS `users_profile`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users_profile` (
`userid` int(11) NOT NULL,
`markdown` text NOT NULL,
`html` text NOT NULL,
PRIMARY KEY (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `votes`
--
DROP TABLE IF EXISTS `votes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`note_id` mediumint(9) NOT NULL,
`ip` bigint(20) unsigned NOT NULL DEFAULT 0,
`hostip` bigint(20) unsigned NOT NULL DEFAULT 0,
`ts` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`vote` tinyint(1) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `note_id` (`note_id`,`ip`,`vote`),
KEY `hostip` (`hostip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-04-07 8:26:18