1 DROP TABLE IF EXISTS `users`;
3 `id` int(11) NOT NULL AUTO_INCREMENT,
4 `email` varchar(255) NOT NULL DEFAULT '',
5 `password` varchar(255) NOT NULL DEFAULT '',
6 `fname` varchar(255) NOT NULL DEFAULT '',
7 `mname` varchar(255) NOT NULL DEFAULT '',
8 `lname` varchar(255) NOT NULL DEFAULT '',
9 `suffix` varchar(50) NOT NULL DEFAULT '',
10 `dob` date NOT NULL DEFAULT '0000-00-00',
11 `verified` int(1) NOT NULL DEFAULT '0',
12 `ccid` int(3) NOT NULL DEFAULT '0',
13 `regid` int(5) NOT NULL DEFAULT '0',
14 `locid` int(7) NOT NULL DEFAULT '0',
15 `listme` int(1) NOT NULL DEFAULT '0',
16 `contactinfo` varchar(255) NOT NULL DEFAULT '',
17 `admin` tinyint(1) NOT NULL DEFAULT '0',
18 `language` varchar(5) NOT NULL DEFAULT '',
19 `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
20 `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
21 `deleted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
22 `locked` tinyint(1) NOT NULL DEFAULT '0',
23 `assurer_blocked` tinyint(1) NOT NULL DEFAULT '0',
26 KEY `regid` (`regid`),
27 KEY `locid` (`locid`),
28 KEY `email` (`email`),
29 KEY `stats_users_created` (`created`),
30 KEY `stats_users_verified` (`verified`),
31 KEY `userverified` (`verified`)
32 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
35 DROP TABLE IF EXISTS `domains`;
36 CREATE TABLE `domains` (
37 `id` int(11) NOT NULL AUTO_INCREMENT,
38 `memid` int(11) NOT NULL,
39 `domain` varchar(255) NOT NULL,
40 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
41 `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
42 `deleted` datetime DEFAULT NULL,
44 KEY `memid` (`memid`),
45 KEY `domain` (`domain`),
46 KEY `stats_domains_deleted` (`deleted`)
47 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
49 DROP TABLE IF EXISTS `emails`;
50 CREATE TABLE `emails` (
51 `id` int(11) NOT NULL AUTO_INCREMENT,
52 `memid` int(11) NOT NULL DEFAULT '0',
53 `email` varchar(255) NOT NULL DEFAULT '',
54 `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
55 `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
56 `deleted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
57 `hash` varchar(50) NOT NULL DEFAULT '',
58 `attempts` int(1) NOT NULL DEFAULT '0',
60 KEY `memid` (`memid`),
61 KEY `stats_email_hash` (`hash`),
62 KEY `stats_email_deleted` (`deleted`),
64 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
66 DROP TABLE IF EXISTS `emailPinglog`;
67 CREATE TABLE `emailPinglog` (
68 `when` datetime NOT NULL,
69 `uid` int(11) NOT NULL,
70 `emailid` int(11) NOT NULL,
71 `type` enum('fast', 'active') NOT NULL,
72 `status` enum('open', 'success', 'failed') NOT NULL,
73 `result` varchar(255) NOT NULL
74 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
76 DROP TABLE IF EXISTS `pingconfig`;
77 CREATE TABLE `pingconfig` (
78 `id` int(13) NOT NULL AUTO_INCREMENT,
79 `domainid` int(11) NOT NULL,
80 `type` enum('email', 'ssl', 'http', 'dns') NOT NULL,
81 `info` varchar(255) NOT NULL,
83 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
86 DROP TABLE IF EXISTS `domainPinglog`;
87 CREATE TABLE `domainPinglog` (
88 `when` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
89 `configId` int(13) NOT NULL,
90 `state` enum('open', 'success', 'failed') NOT NULL,
91 `challenge` varchar(16),
93 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
95 DROP TABLE IF EXISTS `baddomains`;
96 CREATE TABLE `baddomains` (
97 `domain` varchar(255) NOT NULL DEFAULT ''
98 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
101 DROP TABLE IF EXISTS `alerts`;
102 CREATE TABLE `alerts` (
103 `memid` int(11) NOT NULL DEFAULT '0',
104 `general` tinyint(1) NOT NULL DEFAULT '0',
105 `country` tinyint(1) NOT NULL DEFAULT '0',
106 `regional` tinyint(1) NOT NULL DEFAULT '0',
107 `radius` tinyint(1) NOT NULL DEFAULT '0',
108 PRIMARY KEY (`memid`)
109 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
111 DROP TABLE IF EXISTS `user_agreements`;
112 CREATE TABLE `user_agreements` (
113 `id` int(11) NOT NULL AUTO_INCREMENT,
114 `memid` int(11) NOT NULL,
115 `secmemid` int(11) DEFAULT NULL,
116 `document` varchar(50) DEFAULT NULL,
117 `date` datetime DEFAULT NULL,
118 `active` int(1) NOT NULL,
119 `method` varchar(100) NOT NULL,
120 `comment` varchar(100) DEFAULT NULL,
122 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
124 DROP TABLE IF EXISTS `certs`;
125 CREATE TABLE `certs` (
126 `id` int(11) NOT NULL AUTO_INCREMENT,
127 `memid` int(11) NOT NULL DEFAULT '0',
128 `serial` varchar(50) NOT NULL DEFAULT '',
129 `CN` varchar(255) NOT NULL DEFAULT '',
130 `subject` text NOT NULL,
131 `keytype` char(2) NOT NULL DEFAULT 'NS',
132 `codesign` tinyint(1) NOT NULL DEFAULT '0',
133 `md` enum('md5','sha1','sha256','sha512') NOT NULL DEFAULT 'sha512',
134 `profile` int(3) NOT NULL,
136 `csr_name` varchar(255) NOT NULL DEFAULT '',
137 `csr_type` enum('CSR', 'SPKAC') NOT NULL,
138 `crt_name` varchar(255) NOT NULL DEFAULT '',
139 `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
140 `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
141 `revoked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
142 `expire` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
143 `renewed` tinyint(1) NOT NULL DEFAULT '0',
144 `disablelogin` int(1) NOT NULL DEFAULT '0',
145 `pkhash` char(40) DEFAULT NULL,
146 `certhash` char(40) DEFAULT NULL,
147 `description` varchar(100) NOT NULL DEFAULT '',
149 KEY `emailcerts_pkhash` (`pkhash`),
150 KEY `revoked` (`revoked`),
151 KEY `created` (`created`),
152 KEY `memid` (`memid`),
153 KEY `serial` (`serial`),
154 KEY `stats_emailcerts_expire` (`expire`),
155 KEY `emailcrt` (`crt_name`)
156 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
158 DROP TABLE IF EXISTS `clientcerts`;
159 CREATE TABLE `clientcerts` (
160 `id` int(11) NOT NULL,
161 `disablelogin` int(1) NOT NULL DEFAULT '0',
164 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
166 DROP TABLE IF EXISTS `profiles`;
167 CREATE TABLE `profiles` (
168 `id` int(3) NOT NULL AUTO_INCREMENT,
169 `keyname` varchar(60) NOT NULL,
170 `keyUsage` varchar(100) NOT NULL,
171 `extendedKeyUsage` varchar(100) NOT NULL,
172 `rootcert` int(2) NOT NULL DEFAULT '1',
173 `name` varchar(100) NOT NULL,
176 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
177 INSERT INTO `profiles` SET rootcert=0, keyname='client', name='ssl-client (unassured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth';
178 INSERT INTO `profiles` SET rootcert=0, keyname='mail', name='mail (unassured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='emailProtection';
179 INSERT INTO `profiles` SET rootcert=0, keyname='client-mail', name='ssl-client + mail (unassured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth, emailProtection';
180 INSERT INTO `profiles` SET rootcert=0, keyname='server', name='ssl-server (unassured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='serverAuth';
182 INSERT INTO `profiles` SET rootcert=1, keyname='client-a', name='ssl-client (assured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth';
183 INSERT INTO `profiles` SET rootcert=1, keyname='mail-a', name='mail (assured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='emailProtection';
184 INSERT INTO `profiles` SET rootcert=1, keyname='client-mail-a', name='ssl-client + mail(assured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth, emailProtection';
185 INSERT INTO `profiles` SET rootcert=1, keyname='server-a', name='ssl-server (assured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='serverAuth';
187 -- 0=unassured, 1=assured, 2=codesign, 3=orga, 4=orga-sign
188 DROP TABLE IF EXISTS `subjectAlternativeNames`;
189 CREATE TABLE `subjectAlternativeNames` (
190 `certId` int(11) NOT NULL,
191 `contents` varchar(50) NOT NULL,
192 `type` enum('email','DNS') NOT NULL
193 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
198 DROP TABLE IF EXISTS `jobs`;
199 CREATE TABLE `jobs` (
200 `id` int(11) NOT NULL AUTO_INCREMENT,
201 `targetId` int(11) NOT NULL,
202 `task` enum('sign','revoke') NOT NULL,
203 `state` enum('open', 'done', 'error') NOT NULL DEFAULT 'open',
204 `warning` int(2) NOT NULL DEFAULT '0',
206 `executeTo` VARCHAR(11),
208 KEY `state` (`state`)
209 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
212 DROP TABLE IF EXISTS `notary`;
213 CREATE TABLE `notary` (
214 `id` int(11) NOT NULL AUTO_INCREMENT,
215 `from` int(11) NOT NULL DEFAULT '0',
216 `to` int(11) NOT NULL DEFAULT '0',
217 # total points that have been entered
218 `points` int(3) NOT NULL DEFAULT '0',
219 # awarded and the "experience points" are calculated virtually
220 # Face to Face is default, TOPUP is for the remaining 30Points after two TTP
221 # TTP is default ttp assurance
222 `method` enum('Face to Face Meeting', 'TOPUP', 'TTP-Assisted') NOT NULL DEFAULT 'Face to Face Meeting',
223 `location` varchar(255) NOT NULL DEFAULT '',
224 `date` varchar(255) NOT NULL DEFAULT '',
225 # date when assurance was entered
226 `when` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
228 `expire` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
230 `sponsor` int(11) NOT NULL DEFAULT '0',
231 # date when assurance was deleted (or 0)
232 `deleted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
236 KEY `stats_notary_when` (`when`),
237 KEY `stats_notary_method` (`method`)
238 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
241 DROP TABLE IF EXISTS `cats_passed`;
242 CREATE TABLE `cats_passed` (
243 `id` int(11) NOT NULL AUTO_INCREMENT,
244 `user_id` int(11) NOT NULL,
245 `variant_id` int(11) NOT NULL,
246 `pass_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
248 UNIQUE KEY `test_passed` (`user_id`,`variant_id`,`pass_date`)
249 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
251 # --------------------------------------------------------
254 # Table structure for table `cats_type`
257 DROP TABLE IF EXISTS `cats_type`;
258 CREATE TABLE `cats_type` (
259 `id` int(11) NOT NULL AUTO_INCREMENT,
260 `type_text` varchar(255) NOT NULL,
262 UNIQUE KEY `type_text` (`type_text`)
263 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;