From e1e5eb6d4541d865b1fcda093c90da8ba93b537b Mon Sep 17 00:00:00 2001
From: Rob Austein <sra@hactrn.net>
Date: Thu, 27 Mar 2008 15:56:51 +0000
Subject: Add revoked_cert table and rototill child_cert revocation code to use
 it.  Enable MySQLdb exceptions, whack resulting problem with MySQL DATETIME
 object conversion repeatedly with a blunt object.

svn path=/docs/rpki-db-schema.pdf; revision=1564
---
 docs/rpki-db-schema.sql | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'docs/rpki-db-schema.sql')

diff --git a/docs/rpki-db-schema.sql b/docs/rpki-db-schema.sql
index 17fa1541..53421e1f 100644
--- a/docs/rpki-db-schema.sql
+++ b/docs/rpki-db-schema.sql
@@ -141,7 +141,6 @@ CREATE TABLE child_cert (
        child_cert_id        SERIAL NOT NULL,
        cert                 LONGBLOB NOT NULL,
        ski                  TINYBLOB NOT NULL,
-       revoked              DATETIME,
        child_id             BIGINT unsigned NOT NULL,
        ca_detail_id         BIGINT unsigned NOT NULL,
        PRIMARY KEY          (child_cert_id),
@@ -149,6 +148,18 @@ CREATE TABLE child_cert (
        FOREIGN KEY          (child_id) REFERENCES child
 );
 
+DROP TABLE IF EXISTS revoked_cert;
+
+CREATE TABLE revoked_cert (
+       revoked_cert_id      SERIAL NOT NULL,
+       serial               BIGINT unsigned NOT NULL,
+       revoked              DATETIME NOT NULL,
+       expires              DATETIME NOT NULL,
+       ca_detail_id         BIGINT unsigned NOT NULL,
+       PRIMARY KEY          (revoked_cert_id),
+       FOREIGN KEY          (ca_detail_id) REFERENCES ca_detail
+);
+
 DROP TABLE IF EXISTS route_origin;
 
 CREATE TABLE route_origin (
-- 
cgit v1.2.3

