X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=doc%2FtableStructure.sql;h=69f85347fb6d914a8a97decce98beb3dd9e78b1a;hb=bd38586b3f7be34d013bd35510c859612a8c682b;hp=88ba34e09dcab953f49160751b22292899302400;hpb=096591ab96027d81a4fe2e089b8aa31347234308;p=gigi.git diff --git a/doc/tableStructure.sql b/doc/tableStructure.sql index 88ba34e0..69f85347 100644 --- a/doc/tableStructure.sql +++ b/doc/tableStructure.sql @@ -31,8 +31,22 @@ CREATE TABLE `users` ( ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; -DROP TABLE IF EXISTS `email`; -CREATE TABLE `email` ( +DROP TABLE IF EXISTS `domains`; +CREATE TABLE `domains` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `memid` int(11) NOT NULL, + `domain` varchar(255) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `deleted` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `memid` (`memid`), + KEY `domain` (`domain`), + KEY `stats_domains_deleted` (`deleted`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `emails`; +CREATE TABLE `emails` ( `id` int(11) NOT NULL AUTO_INCREMENT, `memid` int(11) NOT NULL DEFAULT '0', `email` varchar(255) NOT NULL DEFAULT '', @@ -85,8 +99,8 @@ CREATE TABLE `user_agreements` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; -DROP TABLE IF EXISTS `emailcerts`; -CREATE TABLE `emailcerts` ( +DROP TABLE IF EXISTS `certs`; +CREATE TABLE `certs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `memid` int(11) NOT NULL DEFAULT '0', `serial` varchar(50) NOT NULL DEFAULT '', @@ -94,21 +108,20 @@ CREATE TABLE `emailcerts` ( `subject` text 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', + `profile` int(3) NOT NULL, + `csr_name` varchar(255) NOT NULL DEFAULT '', + `csr_type` enum('CSR', 'SPKAC') NOT NULL, `crt_name` varchar(255) 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', `revoked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `expire` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `warning` tinyint(1) NOT NULL DEFAULT '0', `renewed` tinyint(1) NOT NULL DEFAULT '0', - `rootcert` int(2) NOT NULL DEFAULT '1', - `md` enum('md5','sha1','sha256','sha512') NOT NULL DEFAULT 'sha512', - `type` tinyint(4) DEFAULT NULL, `disablelogin` int(1) NOT NULL DEFAULT '0', `pkhash` char(40) DEFAULT NULL, `certhash` char(40) DEFAULT NULL, - `coll_found` tinyint(1) NOT NULL, `description` varchar(100) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `emailcerts_pkhash` (`pkhash`), @@ -120,6 +133,51 @@ CREATE TABLE `emailcerts` ( KEY `emailcrt` (`crt_name`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS `clientcerts`; +CREATE TABLE `clientcerts` ( + `id` int(11) NOT NULL, + `disablelogin` int(1) NOT NULL DEFAULT '0', + + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `profiles`; +CREATE TABLE `profiles` ( + `id` int(3) NOT NULL AUTO_INCREMENT, + `keyname` varchar(10) NOT NULL, + `keyUsage` varchar(100) NOT NULL, + `extendedKeyUsage` varchar(100) NOT NULL, + `rootcert` int(2) NOT NULL DEFAULT '1', + `name` varchar(100) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE (`keyname`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; +INSERT INTO `profiles` SET keyname='client', name='ssl-client', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth'; +INSERT INTO `profiles` SET keyname='server', name='ssl-server', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='serverAuth'; +INSERT INTO `profiles` SET keyname='mail', name='mail', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='emailProtection'; + +DROP TABLE IF EXISTS `subjectAlternativeNames`; +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; + + + + +DROP TABLE IF EXISTS `jobs`; +CREATE TABLE `jobs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `targetId` int(11) NOT NULL, + `task` enum('sign','revoke') NOT NULL, + `state` enum('open', 'done', 'error') NOT NULL DEFAULT 'open', + `warning` int(2) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `state` (`state`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; + + DROP TABLE IF EXISTS `notary`; CREATE TABLE `notary` ( `id` int(11) NOT NULL AUTO_INCREMENT,