summaryrefslogtreecommitdiff
path: root/controller/schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'controller/schema.sql')
-rw-r--r--controller/schema.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/controller/schema.sql b/controller/schema.sql
index 25adce40..809c7161 100644
--- a/controller/schema.sql
+++ b/controller/schema.sql
@@ -24,6 +24,15 @@ CREATE TABLE Node (
firstSeen integer NOT NULL DEFAULT(0)
);
+CREATE TABLE Gateway (
+ networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
+ ip blob(16) NOT NULL,
+ ipVersion integer NOT NULL DEFAULT(4),
+ metric integer NOT NULL DEFAULT(0)
+);
+
+CREATE UNIQUE INDEX Gateway_networkId_ip ON Gateway (networkId, ip);
+
CREATE TABLE IpAssignment (
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,