diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-06-13 10:05:34 +0200 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-06-13 10:05:34 +0200 |
commit | 8a9715f183096e35e964a195b61f84bb263a9f85 (patch) | |
tree | 189eafe61f47b4c56b788c1a3c2cf5464096357b /controller/schema.sql | |
parent | 1b122cddbd4dc46083e643a06a9cc258278bf64f (diff) | |
download | infinitytier-8a9715f183096e35e964a195b61f84bb263a9f85.tar.gz infinitytier-8a9715f183096e35e964a195b61f84bb263a9f85.zip |
Rename ruleId to ruleNo and optimize some indexes in Sqlite3 schema.
Diffstat (limited to 'controller/schema.sql')
-rw-r--r-- | controller/schema.sql | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/controller/schema.sql b/controller/schema.sql index a3a7bb7a..25adce40 100644 --- a/controller/schema.sql +++ b/controller/schema.sql @@ -32,12 +32,10 @@ CREATE TABLE IpAssignment ( ipVersion integer NOT NULL DEFAULT(4) ); -CREATE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip); +CREATE UNIQUE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip); CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId); -CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId); - CREATE TABLE IpAssignmentPool ( networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE, ipNetwork blob(16) NOT NULL, @@ -55,8 +53,6 @@ CREATE TABLE Member ( PRIMARY KEY (networkId, nodeId) ); -CREATE INDEX Member_networkId ON Member (networkId); - CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge); CREATE TABLE MulticastRate ( @@ -81,7 +77,7 @@ CREATE INDEX Relay_networkId ON Relay (networkId); CREATE TABLE Rule ( networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE, - ruleId integer NOT NULL, + ruleNo integer NOT NULL, nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE, vlanId integer, vlanPcp integer, @@ -99,4 +95,4 @@ CREATE TABLE Rule ( "action" varchar(4096) NOT NULL DEFAULT('accept') ); -CREATE INDEX Rule_networkId ON Rule (networkId); +CREATE UNIQUE INDEX Rule_networkId_ruleNo ON Rule (networkId, ruleNo); |