X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=doc%2FtableStructure.sql;h=a6f78ed00acdcc9987c4c09e21478caf82721f9c;hp=bab06582c3f8fb803376de19605c9519b3570c57;hb=30a66c84a3f33e99bd5cbfe50b25a83acfbf5425;hpb=0f796ddfef46d1ee06951efc4f3334732e9dabdb diff --git a/doc/tableStructure.sql b/doc/tableStructure.sql index bab06582..a6f78ed0 100644 --- a/doc/tableStructure.sql +++ b/doc/tableStructure.sql @@ -13,13 +13,11 @@ CREATE TABLE `users` ( `regid` int(5) NOT NULL DEFAULT '0', `locid` int(7) NOT NULL DEFAULT '0', `listme` int(1) NOT NULL DEFAULT '0', - `admin` tinyint(1) NOT NULL DEFAULT '0', + `contactinfo` varchar(255) NOT NULL DEFAULT '', `language` varchar(5) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `deleted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `locked` tinyint(1) NOT NULL DEFAULT '0', - `assurer_blocked` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `ccid` (`ccid`), KEY `regid` (`regid`), @@ -43,7 +41,7 @@ CREATE TABLE `domains` ( KEY `memid` (`memid`), KEY `domain` (`domain`), KEY `stats_domains_deleted` (`deleted`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `emails`; CREATE TABLE `emails` ( @@ -60,20 +58,42 @@ CREATE TABLE `emails` ( KEY `stats_email_hash` (`hash`), KEY `stats_email_deleted` (`deleted`), KEY `email` (`email`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; -DROP TABLE IF EXISTS `pinglog`; -CREATE TABLE `pinglog` ( +DROP TABLE IF EXISTS `emailPinglog`; +CREATE TABLE `emailPinglog` ( `when` datetime NOT NULL, `uid` int(11) NOT NULL, `email` varchar(255) NOT NULL, + `type` enum('fast', 'active') NOT NULL, + `status` enum('open', 'success', 'failed') NOT NULL, `result` varchar(255) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `pingconfig`; +CREATE TABLE `pingconfig` ( + `id` int(13) NOT NULL AUTO_INCREMENT, + `domainid` int(11) NOT NULL, + `type` enum('email', 'ssl', 'http', 'dns') NOT NULL, + `info` varchar(255) NOT NULL, + `reping` enum('y','n') NOT NULL DEFAULT 'n', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +DROP TABLE IF EXISTS `domainPinglog`; +CREATE TABLE `domainPinglog` ( + `when` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `configId` int(13) NOT NULL, + `state` enum('open', 'success', 'failed') NOT NULL, + `challenge` varchar(16), + `result` varchar(255) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `baddomains`; CREATE TABLE `baddomains` ( `domain` varchar(255) NOT NULL DEFAULT '' -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `alerts`; @@ -84,7 +104,7 @@ CREATE TABLE `alerts` ( `regional` tinyint(1) NOT NULL DEFAULT '0', `radius` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`memid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `user_agreements`; CREATE TABLE `user_agreements` ( @@ -97,7 +117,7 @@ CREATE TABLE `user_agreements` ( `method` varchar(100) NOT NULL, `comment` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `certs`; CREATE TABLE `certs` ( @@ -105,7 +125,7 @@ CREATE TABLE `certs` ( `memid` int(11) NOT NULL DEFAULT '0', `serial` varchar(50) NOT NULL DEFAULT '', `CN` varchar(255) NOT NULL DEFAULT '', - `subject` text NOT NULL, + `subject` varchar(1024) NOT NULL, `keytype` char(2) NOT NULL DEFAULT 'NS', `codesign` tinyint(1) NOT NULL DEFAULT '0', `md` enum('md5','sha1','sha256','sha512') NOT NULL DEFAULT 'sha512', @@ -131,7 +151,7 @@ CREATE TABLE `certs` ( KEY `serial` (`serial`), KEY `stats_emailcerts_expire` (`expire`), KEY `emailcrt` (`crt_name`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `clientcerts`; CREATE TABLE `clientcerts` ( @@ -139,7 +159,7 @@ CREATE TABLE `clientcerts` ( `disablelogin` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `profiles`; CREATE TABLE `profiles` ( @@ -151,7 +171,7 @@ CREATE TABLE `profiles` ( `name` varchar(100) NOT NULL, PRIMARY KEY (`id`), UNIQUE (`keyname`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; INSERT INTO `profiles` SET rootcert=0, keyname='client', name='ssl-client (unassured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth'; INSERT INTO `profiles` SET rootcert=0, keyname='mail', name='mail (unassured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='emailProtection'; INSERT INTO `profiles` SET rootcert=0, keyname='client-mail', name='ssl-client + mail (unassured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth, emailProtection'; @@ -168,7 +188,7 @@ CREATE TABLE `subjectAlternativeNames` ( `certId` int(11) NOT NULL, `contents` varchar(50) NOT NULL, `type` enum('email','DNS') NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; @@ -180,9 +200,11 @@ CREATE TABLE `jobs` ( `task` enum('sign','revoke') NOT NULL, `state` enum('open', 'done', 'error') NOT NULL DEFAULT 'open', `warning` int(2) NOT NULL DEFAULT '0', + `executeFrom` DATE, + `executeTo` VARCHAR(11), PRIMARY KEY (`id`), KEY `state` (`state`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `notary`; @@ -190,23 +212,28 @@ CREATE TABLE `notary` ( `id` int(11) NOT NULL AUTO_INCREMENT, `from` int(11) NOT NULL DEFAULT '0', `to` int(11) NOT NULL DEFAULT '0', - `awarded` int(3) NOT NULL DEFAULT '0', +# total points that have been entered `points` int(3) NOT NULL DEFAULT '0', - `method` enum('Face to Face Meeting','Trusted Third Parties','Thawte Points Transfer','Administrative Increase','CT Magazine - Germany','Temporary Increase','Unknown','TOPUP','TTP-Assisted') NOT NULL DEFAULT 'Face to Face Meeting', +# awarded and the "experience points" are calculated virtually +# Face to Face is default, TOPUP is for the remaining 30Points after two TTP +# TTP is default ttp assurance + `method` enum('Face to Face Meeting', 'TOPUP', 'TTP-Assisted') NOT NULL DEFAULT 'Face to Face Meeting', `location` varchar(255) NOT NULL DEFAULT '', `date` varchar(255) NOT NULL DEFAULT '', +# date when assurance was entered `when` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', +#? `expire` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', +#????????????????? `sponsor` int(11) NOT NULL DEFAULT '0', +# date when assurance was deleted (or 0) `deleted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), KEY `from` (`from`), KEY `to` (`to`), - KEY `from_2` (`from`), - KEY `to_2` (`to`), KEY `stats_notary_when` (`when`), KEY `stats_notary_method` (`method`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `cats_passed`; @@ -217,7 +244,7 @@ CREATE TABLE `cats_passed` ( `pass_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `test_passed` (`user_id`,`variant_id`,`pass_date`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; # -------------------------------------------------------- @@ -231,4 +258,23 @@ CREATE TABLE `cats_type` ( `type_text` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `type_text` (`type_text`) -) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `arbitrations`; +CREATE TABLE IF NOT EXISTS `arbitrations` ( + `user` int(11) NOT NULL, + `arbitration` varchar(20) NOT NULL, + PRIMARY KEY (`user`,`arbitration`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `user_groups`; +CREATE TABLE IF NOT EXISTS `user_groups` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user` int(11) NOT NULL, + `permission` enum('supporter','arbitrator','blockedassuree','blockedassurer','blockedlogin','ttp-assurer','ttp-applicant', 'codesigning') NOT NULL, + `granted` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `deleted` timestamp NULL DEFAULT NULL, + `grantedby` int(11) NOT NULL, + `revokedby` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8;