From 4d5490ad9de2d794c6fb4cd65c15a20c312a6b29 Mon Sep 17 00:00:00 2001
From: Rob Austein <sra@hactrn.net>
Date: Tue, 25 Sep 2007 15:58:53 +0000
Subject: sqlt doesn't like "ADD PRIMARY KEY"

svn path=/docs/sample-irdb.sql; revision=1022
---
 docs/sample-irdb.sql | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

(limited to 'docs/sample-irdb.sql')

diff --git a/docs/sample-irdb.sql b/docs/sample-irdb.sql
index c6a5d9f9..083577d0 100644
--- a/docs/sample-irdb.sql
+++ b/docs/sample-irdb.sql
@@ -1,10 +1,12 @@
 
 DROP TABLE IF EXISTS asn;
+
 CREATE TABLE asn (
        asn_id               SERIAL NOT NULL,
        start_as             BIGINT unsigned NOT NULL,
        end_as               BIGINT unsigned NOT NULL,
-       resource_class_id    BIGINT unsigned NOT NULL
+       resource_class_id    BIGINT unsigned NOT NULL,
+       PRIMARY KEY (asn_id)
 );
 
 CREATE UNIQUE INDEX XPKasn ON asn
@@ -12,9 +14,6 @@ CREATE UNIQUE INDEX XPKasn ON asn
        asn_id
 );
 
-ALTER TABLE asn
-       ADD PRIMARY KEY (asn_id);
-
 DROP TABLE IF EXISTS net;
 
 CREATE TABLE net (
@@ -22,7 +21,8 @@ CREATE TABLE net (
        start_ip             VARCHAR(40) NOT NULL,
        end_ip               VARCHAR(40) NOT NULL,
        version              TINYINT unsigned NOT NULL,
-       resource_class_id    BIGINT unsigned NOT NULL
+       resource_class_id    BIGINT unsigned NOT NULL,
+       PRIMARY KEY (net_id)
 );
 
 CREATE UNIQUE INDEX XPKnet ON net
@@ -30,15 +30,12 @@ CREATE UNIQUE INDEX XPKnet ON net
        net_id
 );
 
-ALTER TABLE net
-       ADD PRIMARY KEY (net_id);
-
-
 DROP TABLE IF EXISTS registrant;
 
 CREATE TABLE registrant (
        registrant_id        SERIAL NOT NULL,
-       IRBE_mapped_id       TEXT
+       IRBE_mapped_id       TEXT,
+       PRIMARY KEY (registrant_id)
 );
 
 CREATE UNIQUE INDEX XPKregistrant ON registrant
@@ -46,16 +43,14 @@ CREATE UNIQUE INDEX XPKregistrant ON registrant
        registrant_id
 );
 
-ALTER TABLE registrant
-       ADD PRIMARY KEY (registrant_id);
-
 DROP TABLE IF EXISTS resource_class;
 
 CREATE TABLE resource_class (
        resource_class_id    SERIAL NOT NULL,
        subject_name         TEXT,
        valid_until          DATETIME NOT NULL,
-       registrant_id        BIGINT unsigned NOT NULL
+       registrant_id        BIGINT unsigned NOT NULL,
+       PRIMARY KEY (resource_class_id)
 );
 
 CREATE UNIQUE INDEX XPKresource_class ON resource_class
@@ -63,9 +58,6 @@ CREATE UNIQUE INDEX XPKresource_class ON resource_class
        resource_class_id
 );
 
-ALTER TABLE resource_class
-       ADD PRIMARY KEY (resource_class_id);
-
 ALTER TABLE asn
        ADD FOREIGN KEY (resource_class_id)
                              REFERENCES resource_class
-- 
cgit v1.2.3

