diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/rpki-db-schema.pdf | bin | 5489 -> 7244 bytes | |||
-rw-r--r-- | docs/rpki-db-schema.sql | 212 | ||||
-rw-r--r-- | docs/sample-irdb.pdf | bin | 1949 -> 3500 bytes | |||
-rw-r--r-- | docs/sample-irdb.sql | 42 |
4 files changed, 127 insertions, 127 deletions
diff --git a/docs/rpki-db-schema.pdf b/docs/rpki-db-schema.pdf Binary files differindex d9b4e595..4fa401ae 100644 --- a/docs/rpki-db-schema.pdf +++ b/docs/rpki-db-schema.pdf diff --git a/docs/rpki-db-schema.sql b/docs/rpki-db-schema.sql index 53421e1f..25fe77a8 100644 --- a/docs/rpki-db-schema.sql +++ b/docs/rpki-db-schema.sql @@ -17,173 +17,173 @@ DROP TABLE IF EXISTS self; CREATE TABLE self ( - self_id SERIAL NOT NULL, - use_hsm BOOLEAN, - crl_interval BIGINT unsigned, - PRIMARY KEY (self_id) + self_id SERIAL NOT NULL, + use_hsm BOOLEAN, + crl_interval BIGINT unsigned, + PRIMARY KEY (self_id) ); DROP TABLE IF EXISTS self_pref; CREATE TABLE self_pref ( - pref_name VARCHAR(100), - pref_value TEXT, - self_id BIGINT unsigned NOT NULL, - PRIMARY KEY (self_id, pref_name), - FOREIGN KEY (self_id) REFERENCES self + pref_name VARCHAR(100), + pref_value TEXT, + self_id BIGINT unsigned NOT NULL, + PRIMARY KEY (self_id, pref_name), + FOREIGN KEY (self_id) REFERENCES self ); DROP TABLE IF EXISTS bsc; CREATE TABLE bsc ( - bsc_id SERIAL NOT NULL, - private_key_id LONGBLOB, - self_id BIGINT unsigned NOT NULL, - public_key LONGBLOB, - hash_alg TEXT, - PRIMARY KEY (bsc_id), - FOREIGN KEY (self_id) REFERENCES self + bsc_id SERIAL NOT NULL, + private_key_id LONGBLOB, + self_id BIGINT unsigned NOT NULL, + public_key LONGBLOB, + hash_alg ENUM ('sha256'), + PRIMARY KEY (bsc_id), + FOREIGN KEY (self_id) REFERENCES self ); DROP TABLE IF EXISTS bsc_cert; CREATE TABLE bsc_cert ( - bsc_cert_id SERIAL NOT NULL, - cert LONGBLOB, - bsc_id BIGINT unsigned NOT NULL, - PRIMARY KEY (bsc_cert_id), - FOREIGN KEY (bsc_id) REFERENCES bsc + bsc_cert_id SERIAL NOT NULL, + cert LONGBLOB, + bsc_id BIGINT unsigned NOT NULL, + PRIMARY KEY (bsc_cert_id), + FOREIGN KEY (bsc_id) REFERENCES bsc ); DROP TABLE IF EXISTS repository; CREATE TABLE repository ( - repository_id SERIAL NOT NULL, - peer_contact_uri TEXT, - cms_ta LONGBLOB, - https_ta LONGBLOB, - bsc_id BIGINT unsigned NOT NULL, - self_id BIGINT unsigned NOT NULL, - PRIMARY KEY (repository_id), - FOREIGN KEY (self_id) REFERENCES self, - FOREIGN KEY (bsc_id) REFERENCES bsc + repository_id SERIAL NOT NULL, + peer_contact_uri TEXT, + cms_ta LONGBLOB, + https_ta LONGBLOB, + bsc_id BIGINT unsigned NOT NULL, + self_id BIGINT unsigned NOT NULL, + PRIMARY KEY (repository_id), + FOREIGN KEY (self_id) REFERENCES self, + FOREIGN KEY (bsc_id) REFERENCES bsc ); DROP TABLE IF EXISTS parent; CREATE TABLE parent ( - parent_id SERIAL NOT NULL, - cms_ta LONGBLOB, - https_ta LONGBLOB, - peer_contact_uri TEXT, - sia_base TEXT, - sender_name TEXT, - recipient_name TEXT, - self_id BIGINT unsigned NOT NULL, - bsc_id BIGINT unsigned NOT NULL, - repository_id BIGINT unsigned NOT NULL, - PRIMARY KEY (parent_id), - FOREIGN KEY (repository_id) REFERENCES repository, - FOREIGN KEY (bsc_id) REFERENCES bsc, - FOREIGN KEY (self_id) REFERENCES self + parent_id SERIAL NOT NULL, + cms_ta LONGBLOB, + https_ta LONGBLOB, + peer_contact_uri TEXT, + sia_base TEXT, + sender_name TEXT, + recipient_name TEXT, + self_id BIGINT unsigned NOT NULL, + bsc_id BIGINT unsigned NOT NULL, + repository_id BIGINT unsigned NOT NULL, + PRIMARY KEY (parent_id), + FOREIGN KEY (repository_id) REFERENCES repository, + FOREIGN KEY (bsc_id) REFERENCES bsc, + FOREIGN KEY (self_id) REFERENCES self ); DROP TABLE IF EXISTS ca; CREATE TABLE ca ( - ca_id SERIAL NOT NULL, - last_crl_sn BIGINT unsigned NOT NULL, - last_manifest_sn BIGINT unsigned NOT NULL, - next_manifest_update DATETIME, - next_crl_update DATETIME, - last_issued_sn BIGINT unsigned NOT NULL, - sia_uri TEXT, - parent_resource_class TEXT, - parent_id BIGINT unsigned, - PRIMARY KEY (ca_id), - FOREIGN KEY (parent_id) REFERENCES parent + ca_id SERIAL NOT NULL, + last_crl_sn BIGINT unsigned NOT NULL, + last_manifest_sn BIGINT unsigned NOT NULL, + next_manifest_update DATETIME, + next_crl_update DATETIME, + last_issued_sn BIGINT unsigned NOT NULL, + sia_uri TEXT, + parent_resource_class TEXT, + parent_id BIGINT unsigned, + PRIMARY KEY (ca_id), + FOREIGN KEY (parent_id) REFERENCES parent ); DROP TABLE IF EXISTS ca_detail; CREATE TABLE ca_detail ( - ca_detail_id SERIAL NOT NULL, - public_key LONGBLOB, - private_key_id LONGBLOB, - latest_crl LONGBLOB, - latest_ca_cert LONGBLOB, - manifest_private_key_id LONGBLOB, - manifest_public_key LONGBLOB, - latest_manifest_cert LONGBLOB, - latest_manifest LONGBLOB, - state ENUM ('pending', 'active', 'deprecated', 'revoked') NOT NULL, - ca_cert_uri TEXT, - ca_id BIGINT unsigned NOT NULL, - PRIMARY KEY (ca_detail_id), - FOREIGN KEY (ca_id) REFERENCES ca + ca_detail_id SERIAL NOT NULL, + public_key LONGBLOB, + private_key_id LONGBLOB, + latest_crl LONGBLOB, + latest_ca_cert LONGBLOB, + manifest_private_key_id LONGBLOB, + manifest_public_key LONGBLOB, + latest_manifest_cert LONGBLOB, + latest_manifest LONGBLOB, + state ENUM ('pending', 'active', 'deprecated', 'revoked') NOT NULL, + ca_cert_uri TEXT, + ca_id BIGINT unsigned NOT NULL, + PRIMARY KEY (ca_detail_id), + FOREIGN KEY (ca_id) REFERENCES ca ); DROP TABLE IF EXISTS child; CREATE TABLE child ( - child_id SERIAL NOT NULL, - cms_ta LONGBLOB, - self_id BIGINT unsigned NOT NULL, - bsc_id BIGINT unsigned NOT NULL, - PRIMARY KEY (child_id), - FOREIGN KEY (bsc_id) REFERENCES bsc, - FOREIGN KEY (self_id) REFERENCES self + child_id SERIAL NOT NULL, + cms_ta LONGBLOB, + self_id BIGINT unsigned NOT NULL, + bsc_id BIGINT unsigned NOT NULL, + PRIMARY KEY (child_id), + FOREIGN KEY (bsc_id) REFERENCES bsc, + FOREIGN KEY (self_id) REFERENCES self ); DROP TABLE IF EXISTS child_cert; CREATE TABLE child_cert ( - child_cert_id SERIAL NOT NULL, - cert LONGBLOB NOT NULL, - ski TINYBLOB NOT NULL, - child_id BIGINT unsigned NOT NULL, - ca_detail_id BIGINT unsigned NOT NULL, - PRIMARY KEY (child_cert_id), - FOREIGN KEY (ca_detail_id) REFERENCES ca_detail, - FOREIGN KEY (child_id) REFERENCES child + child_cert_id SERIAL NOT NULL, + cert LONGBLOB NOT NULL, + ski TINYBLOB NOT NULL, + child_id BIGINT unsigned NOT NULL, + ca_detail_id BIGINT unsigned NOT NULL, + PRIMARY KEY (child_cert_id), + FOREIGN KEY (ca_detail_id) REFERENCES ca_detail, + 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 + 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 ( - route_origin_id SERIAL NOT NULL, - as_number DECIMAL(24,0), - cert LONGBLOB, - 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 (ca_detail_id) REFERENCES ca_detail + route_origin_id SERIAL NOT NULL, + as_number DECIMAL(24,0), + cert LONGBLOB, + 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 (ca_detail_id) REFERENCES ca_detail ); DROP TABLE IF EXISTS route_origin_range; CREATE TABLE route_origin_range ( - start_ip VARCHAR(40), - end_ip VARCHAR(40), - route_origin_id BIGINT unsigned NOT NULL, - PRIMARY KEY (route_origin_id, start_ip, end_ip), - FOREIGN KEY (route_origin_id) REFERENCES route_origin + start_ip VARCHAR(40), + end_ip VARCHAR(40), + route_origin_id BIGINT unsigned NOT NULL, + PRIMARY KEY (route_origin_id, start_ip, end_ip), + FOREIGN KEY (route_origin_id) REFERENCES route_origin ); -- Local Variables: --- indent-tab-mode: nil +-- indent-tabs-mode: nil -- End: diff --git a/docs/sample-irdb.pdf b/docs/sample-irdb.pdf Binary files differindex e4442245..aa1d4441 100644 --- a/docs/sample-irdb.pdf +++ b/docs/sample-irdb.pdf diff --git a/docs/sample-irdb.sql b/docs/sample-irdb.sql index d70f128d..f5c8c970 100644 --- a/docs/sample-irdb.sql +++ b/docs/sample-irdb.sql @@ -17,38 +17,38 @@ DROP TABLE IF EXISTS registrant; CREATE TABLE registrant ( - registrant_id SERIAL NOT NULL, - IRBE_mapped_id TEXT, - subject_name TEXT, - rpki_self_id BIGINT unsigned, - rpki_child_id BIGINT unsigned, - valid_until DATETIME NOT NULL, - PRIMARY KEY (registrant_id) + registrant_id SERIAL NOT NULL, + IRBE_mapped_id TEXT, + subject_name TEXT, + rpki_self_id BIGINT unsigned, + rpki_child_id BIGINT unsigned, + valid_until DATETIME NOT NULL, + PRIMARY KEY (registrant_id) ); 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, - registrant_id BIGINT unsigned NOT NULL, - PRIMARY KEY (asn_id), - FOREIGN KEY (registrant_id) REFERENCES registrant ON DELETE SET NULL ON UPDATE SET NULL + asn_id SERIAL NOT NULL, + start_as BIGINT unsigned NOT NULL, + end_as BIGINT unsigned NOT NULL, + registrant_id BIGINT unsigned NOT NULL, + PRIMARY KEY (asn_id), + FOREIGN KEY (registrant_id) REFERENCES registrant ON DELETE SET NULL ON UPDATE SET NULL ); DROP TABLE IF EXISTS net; CREATE TABLE net ( - net_id SERIAL NOT NULL, - start_ip VARCHAR(40) NOT NULL, - end_ip VARCHAR(40) NOT NULL, - version TINYINT unsigned NOT NULL, - registrant_id BIGINT unsigned NOT NULL, - PRIMARY KEY (net_id), - FOREIGN KEY (registrant_id) REFERENCES registrant ON DELETE SET NULL ON UPDATE SET NULL + net_id SERIAL NOT NULL, + start_ip VARCHAR(40) NOT NULL, + end_ip VARCHAR(40) NOT NULL, + version TINYINT unsigned NOT NULL, + registrant_id BIGINT unsigned NOT NULL, + PRIMARY KEY (net_id), + FOREIGN KEY (registrant_id) REFERENCES registrant ON DELETE SET NULL ON UPDATE SET NULL ); -- Local Variables: --- indent-tab-mode: nil +-- indent-tabs-mode: nil -- End: |