From ef6450b92617e755c9cb5039ba2aa94972dc52bc Mon Sep 17 00:00:00 2001
From: Rob Austein <sra@hactrn.net>
Date: Mon, 1 Oct 2007 23:29:43 +0000
Subject: Fold roa table into route_origin table.

svn path=/docs/rpki-db-schema.pdf; revision=1069
---
 docs/rpki-db-schema.sql | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

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

diff --git a/docs/rpki-db-schema.sql b/docs/rpki-db-schema.sql
index d9af186d..894dea6a 100644
--- a/docs/rpki-db-schema.sql
+++ b/docs/rpki-db-schema.sql
@@ -130,9 +130,12 @@ DROP TABLE IF EXISTS route_origin;
 CREATE TABLE route_origin (
        route_origin_id      SERIAL NOT NULL,
        as_number            DECIMAL(24,0),
+       roa                  LONGBLOB,
        self_id              BIGINT unsigned NOT NULL,
+       ca_detail_id         BIGINT unsigned,
        PRIMARY KEY          (route_origin_id),
-       FOREIGN KEY          (self_id) REFERENCES self
+       FOREIGN KEY          (self_id) REFERENCES self,
+       FOREIGN KEY          (ca_detail_id) REFERENCES ca_detail
 );
 
 DROP TABLE IF EXISTS route_origin_range;
@@ -144,15 +147,3 @@ CREATE TABLE route_origin_range (
        PRIMARY KEY          (route_origin_id, start_ip, end_ip),
        FOREIGN KEY          (route_origin_id) REFERENCES route_origin
 );
-
-DROP TABLE IF EXISTS roa;
-
-CREATE TABLE roa (
-       route_origin_id      BIGINT unsigned NOT NULL,
-       ee_cert              LONGBLOB,
-       roa                  LONGBLOB NOT NULL,
-       ca_detail_id         BIGINT unsigned NOT NULL,
-       PRIMARY KEY          (route_origin_id, ca_detail_id),
-       FOREIGN KEY          (ca_detail_id) REFERENCES ca_detail,
-       FOREIGN KEY          (route_origin_id) REFERENCES route_origin
-);
-- 
cgit v1.2.3

