]> WPIA git - gigi.git/blobdiff - doc/tableStructure.sql
UPD: Cleanup assurance table.
[gigi.git] / doc / tableStructure.sql
index d3cf2471a5ea2dd5f564e5c867bf9c5c2763bbb1..468f2bbef35002c90abcb62fd52b9c3af417a355 100644 (file)
@@ -13,6 +13,7 @@ CREATE TABLE `users` (
   `regid` int(5) NOT NULL DEFAULT '0',
   `locid` int(7) NOT NULL DEFAULT '0',
   `listme` int(1) NOT NULL DEFAULT '0',
+  `contactinfo` varchar(255) NOT NULL DEFAULT '',
   `admin` tinyint(1) NOT NULL DEFAULT '0',
   `language` varchar(5) NOT NULL DEFAULT '',
   `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -31,8 +32,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 '',
@@ -48,14 +63,35 @@ CREATE TABLE `email` (
   KEY `email` (`email`)
 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
 
-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,
+  `emailid` int(11) 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;
 
+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,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+
+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=latin1;
+
 DROP TABLE IF EXISTS `baddomains`;
 CREATE TABLE `baddomains` (
   `domain` varchar(255) NOT NULL DEFAULT ''
@@ -85,8 +121,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 '',
@@ -95,8 +131,7 @@ CREATE TABLE `emailcerts` (
   `keytype` char(2) NOT NULL DEFAULT 'NS',
   `codesign` tinyint(1) NOT NULL DEFAULT '0',
   `md` enum('md5','sha1','sha256','sha512') NOT NULL DEFAULT 'sha512',
-  `rootcert` int(2) NOT NULL DEFAULT '1',
-  `type` enum('client', 'server') DEFAULT NULL,
+  `profile` int(3) NOT NULL,
 
   `csr_name` varchar(255) NOT NULL DEFAULT '',
   `csr_type` enum('CSR', 'SPKAC') NOT NULL,
@@ -128,6 +163,36 @@ CREATE TABLE `clientcerts` (
   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(60) 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 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';
+INSERT INTO `profiles` SET rootcert=0, keyname='server', name='ssl-server (unassured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='serverAuth';
+
+INSERT INTO `profiles` SET rootcert=1, keyname='client-a', name='ssl-client (assured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth';
+INSERT INTO `profiles` SET rootcert=1, keyname='mail-a',  name='mail (assured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='emailProtection';
+INSERT INTO `profiles` SET rootcert=1, keyname='client-mail-a', name='ssl-client + mail(assured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='clientAuth, emailProtection';
+INSERT INTO `profiles` SET rootcert=1, keyname='server-a', name='ssl-server (assured)', keyUsage='digitalSignature, keyEncipherment, keyAgreement', extendedKeyUsage='serverAuth';
+
+-- 0=unassured, 1=assured, 2=codesign, 3=orga, 4=orga-sign
+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`;
@@ -137,6 +202,8 @@ 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;
@@ -147,20 +214,25 @@ 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;