+) 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(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`;
+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',
+ `executeFrom` DATE,
+ `executeTo` VARCHAR(11),
+ 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,
+ `from` int(11) NOT NULL DEFAULT '0',
+ `to` int(11) NOT NULL DEFAULT '0',
+# total points that have been entered
+ `points` int(3) NOT NULL DEFAULT '0',
+# 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 `stats_notary_when` (`when`),
+ KEY `stats_notary_method` (`method`)
+) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
+
+
+DROP TABLE IF EXISTS `cats_passed`;
+CREATE TABLE `cats_passed` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `user_id` int(11) NOT NULL,
+ `variant_id` int(11) NOT NULL,
+ `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;
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `cats_type`
+#
+
+DROP TABLE IF EXISTS `cats_type`;
+CREATE TABLE `cats_type` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `type_text` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `type_text` (`type_text`)
+) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;