);
DROP TABLE IF EXISTS "certs";
+DROP TYPE IF EXISTS "revocationType";
+CREATE TYPE "revocationType" AS ENUM('user', 'support', 'ping_timeout', 'key_compromise');
DROP TYPE IF EXISTS "mdType";
-CREATE TYPE "mdType" AS ENUM('md5','sha1','sha256','sha512');
+CREATE TYPE "mdType" AS ENUM('md5','sha1','sha256','sha384','sha512');
DROP TYPE IF EXISTS "csrType";
CREATE TYPE "csrType" AS ENUM ('CSR', 'SPKAC');
"profile" int NOT NULL,
"caid" int NULL DEFAULT NULL,
- "csr_name" varchar(255) NOT NULL DEFAULT '',
"csr_type" "csrType" NOT NULL,
- "crt_name" varchar(255) NOT NULL DEFAULT '',
"created" timestamp NULL DEFAULT NULL,
"modified" timestamp NULL DEFAULT NULL,
- "revoked" timestamp NULL DEFAULT NULL,
+
+ "revoked" timestamp NULL,
+ "revocationType" "revocationType" NULL,
+ "revocationChallenge" varchar(32) NULL DEFAULT NULL,
+ "revocationSignature" text NULL DEFAULT NULL,
+ "revocationMessage" text NULL DEFAULT NULL,
+
"expire" timestamp NULL DEFAULT NULL,
"renewed" boolean NOT NULL DEFAULT 'false',
"pkhash" char(40) DEFAULT NULL,
CREATE INDEX ON "certs" ("memid");
CREATE INDEX ON "certs" ("serial");
CREATE INDEX ON "certs" ("expire");
-CREATE INDEX ON "certs" ("crt_name");
-
-
DROP TABLE IF EXISTS "certAvas";
CREATE TABLE "certAvas" (
"targetId" int NOT NULL,
"task" "jobType" NOT NULL,
"state" "jobState" NOT NULL DEFAULT 'open',
- "warning" smallint NOT NULL DEFAULT '0',
+ "attempt" smallint NOT NULL DEFAULT '0',
"executeFrom" DATE,
"executeTo" VARCHAR(11),
PRIMARY KEY ("id")
DROP TABLE IF EXISTS "user_groups";
DROP TYPE IF EXISTS "userGroup";
-CREATE TYPE "userGroup" AS enum('supporter','arbitrator','blockedassuree','blockedassurer','blockedlogin','ttp-assurer','ttp-applicant', 'codesigning', 'orgassurer', 'blockedcert', 'nucleus-assurer', 'locate-agent', 'verify-notification');
+CREATE TYPE "userGroup" AS enum('supporter','blocked-applicant','blocked-agent','blocked-login','ttp-agent','ttp-applicant', 'codesigning', 'org-agent', 'blocked-cert', 'nucleus-agent', 'locate-agent', 'verify-notification');
CREATE TABLE IF NOT EXISTS "user_groups" (
"id" serial NOT NULL,
"version" smallint NOT NULL,
PRIMARY KEY ("version")
);
-INSERT INTO "schemeVersion" (version) VALUES(26);
+INSERT INTO "schemeVersion" (version) VALUES(34);
DROP TABLE IF EXISTS `passwordResetTickets`;
CREATE TABLE `passwordResetTickets` (
"type" "namePartType" NOT NULL,
"value" varchar(255) NOT NULL
);
+
+
+DROP TABLE IF EXISTS "certificateAttachment";
+DROP TYPE IF EXISTS "certificateAttachmentType";
+CREATE TYPE "certificateAttachmentType" AS ENUM ('CSR','CRT');
+
+CREATE TABLE "certificateAttachment" (
+ "certid" int NOT NULL,
+ "type" "certificateAttachmentType" NOT NULL,
+ "content" text NOT NULL,
+ PRIMARY KEY ("certid", "type")
+);
+
+DROP TABLE IF EXISTS "jobLog";
+CREATE TABLE "jobLog" (
+ "jobid" int NOT NULL,
+ "attempt" smallint NOT NULL,
+ "content" text NOT NULL,
+ PRIMARY KEY ("jobid", "attempt")
+);
+CREATE INDEX ON "jobLog" ("jobid");