summaryrefslogtreecommitdiff
path: root/controller/schema.sql
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-02-03 13:56:35 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-02-03 13:56:35 -0800
commitf8eb6b00674a218cef20fd2ad6803fdecabc82ab (patch)
treef9cb962c9bfb60c41fb4721abcf1f40c51c2dc0c /controller/schema.sql
parent7a63fdc447322da3630774a894822bbe6fbb708f (diff)
downloadinfinitytier-f8eb6b00674a218cef20fd2ad6803fdecabc82ab.tar.gz
infinitytier-f8eb6b00674a218cef20fd2ad6803fdecabc82ab.zip
Add NodeHistory table on sqlite controller.
Diffstat (limited to 'controller/schema.sql')
-rw-r--r--controller/schema.sql14
1 files changed, 14 insertions, 0 deletions
diff --git a/controller/schema.sql b/controller/schema.sql
index b6db7fa4..c40e5cac 100644
--- a/controller/schema.sql
+++ b/controller/schema.sql
@@ -34,6 +34,20 @@ CREATE TABLE Node (
identity varchar(4096) NOT NULL
);
+CREATE TABLE NodeHistory (
+ nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,
+ networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
+ networkVisitCounter INTEGER NOT NULL DEFAULT(0),
+ networkRequestAuthorized INTEGER NOT NULL DEFAULT(0),
+ requestTime INTEGER NOT NULL DEFAULT(0),
+ networkRequestMetaData VARCHAR(1024),
+ fromAddress VARCHAR(128)
+);
+
+CREATE INDEX NodeHistory_nodeId ON NodeHistory (nodeId);
+CREATE INDEX NodeHistory_networkId ON NodeHistory (networkId);
+CREATE INDEX NodeHistory_requestTime ON NodeHistory (requestTime);
+
CREATE TABLE Gateway (
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
ip blob(16) NOT NULL,