aboutsummaryrefslogtreecommitdiffstats
path: root/schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql115
1 files changed, 115 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql
new file mode 100644
index 0000000..593f4c2
--- /dev/null
+++ b/schema.sql
@@ -0,0 +1,115 @@
+create schema peeringdb;
+
+create table peeringdb.org (
+ id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.net (
+ id int not null,
+ org_id int not null,
+ asn int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.ix (
+ id int not null,
+ org_id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.fac (
+ id int not null,
+ org_id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.poc (
+ id int not null,
+ net_id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.ixlan (
+ id int not null,
+ ix_id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.ixpfx (
+ id int not null,
+ ixlan_id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.ixfac (
+ id int not null,
+ ix_id int not null,
+ fac_id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.netfac (
+ id int not null,
+ net_id int not null,
+ fac_id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);
+
+create table peeringdb.netixlan (
+ id int not null,
+ net_id int not null,
+ ix_id int not null,
+ ixlan_id int not null,
+ status text not null,
+ data jsonb not null,
+ created timestamptz not null,
+ updated timestamptz not null,
+ deleted timestamptz,
+ primary key (id)
+);