aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@a5n.dk>2024-11-07 21:50:31 +0000
committerAsbjørn Sloth Tønnesen <ast@a5n.dk>2024-11-07 21:50:31 +0000
commitfef29917c688da707f3a49871efda72010042155 (patch)
treebe07723b3ff26273a648e17385f919f0fad2013b
parent9d0ecfa813820991523daa3bb481ddbd8f1e3ae9 (diff)
downloadpeeringdb-simplesync-fef29917c688da707f3a49871efda72010042155.tar.gz
peeringdb-simplesync-fef29917c688da707f3a49871efda72010042155.tar.xz
peeringdb-simplesync-fef29917c688da707f3a49871efda72010042155.zip
schema: add if not exists
Signed-off-by: Asbjørn Sloth Tønnesen <ast@a5n.dk>
-rw-r--r--schema.sql22
1 files changed, 11 insertions, 11 deletions
diff --git a/schema.sql b/schema.sql
index f658f38..7c48bc8 100644
--- a/schema.sql
+++ b/schema.sql
@@ -1,6 +1,6 @@
-create schema peeringdb;
+CREATE SCHEMA IF NOT EXISTS peeringdb;
-create table peeringdb.org (
+CREATE TABLE IF NOT EXISTS peeringdb.org (
id int not null,
status text not null,
data jsonb not null,
@@ -10,7 +10,7 @@ create table peeringdb.org (
primary key (id)
);
-create table peeringdb.net (
+CREATE TABLE IF NOT EXISTS peeringdb.net (
id int not null,
org_id int not null,
asn bigint not null,
@@ -22,7 +22,7 @@ create table peeringdb.net (
primary key (id)
);
-create table peeringdb.ix (
+CREATE TABLE IF NOT EXISTS peeringdb.ix (
id int not null,
org_id int not null,
status text not null,
@@ -33,7 +33,7 @@ create table peeringdb.ix (
primary key (id)
);
-create table peeringdb.fac (
+CREATE TABLE IF NOT EXISTS peeringdb.fac (
id int not null,
org_id int not null,
status text not null,
@@ -44,7 +44,7 @@ create table peeringdb.fac (
primary key (id)
);
-create table peeringdb.poc (
+CREATE TABLE IF NOT EXISTS peeringdb.poc (
id int not null,
net_id int not null,
status text not null,
@@ -55,7 +55,7 @@ create table peeringdb.poc (
primary key (id)
);
-create table peeringdb.ixlan (
+CREATE TABLE IF NOT EXISTS peeringdb.ixlan (
id int not null,
ix_id int not null,
status text not null,
@@ -66,7 +66,7 @@ create table peeringdb.ixlan (
primary key (id)
);
-create table peeringdb.ixpfx (
+CREATE TABLE IF NOT EXISTS peeringdb.ixpfx (
id int not null,
ixlan_id int not null,
status text not null,
@@ -77,7 +77,7 @@ create table peeringdb.ixpfx (
primary key (id)
);
-create table peeringdb.ixfac (
+CREATE TABLE IF NOT EXISTS peeringdb.ixfac (
id int not null,
ix_id int not null,
fac_id int not null,
@@ -89,7 +89,7 @@ create table peeringdb.ixfac (
primary key (id)
);
-create table peeringdb.netfac (
+CREATE TABLE IF NOT EXISTS peeringdb.netfac (
id int not null,
net_id int not null,
fac_id int not null,
@@ -101,7 +101,7 @@ create table peeringdb.netfac (
primary key (id)
);
-create table peeringdb.netixlan (
+CREATE TABLE IF NOT EXISTS peeringdb.netixlan (
id int not null,
net_id int not null,
ix_id int not null,