From 48a2ad032aa39dab2980787b2746360655c1859f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 29 Jun 2015 10:47:47 -0700 Subject: (1) Both nodeId and portId in Rule can be NULL, (2) remove on delete cascade since rules should never mysteriously disappear from the rules table. If it let you delete a node with rules, that would be a UI or cleanup function bug. --- controller/schema.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'controller/schema.sql') diff --git a/controller/schema.sql b/controller/schema.sql index a3193f7d..1328d999 100644 --- a/controller/schema.sql +++ b/controller/schema.sql @@ -77,8 +77,8 @@ CREATE INDEX Relay_networkId ON Relay (networkId); CREATE TABLE Rule ( networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE, ruleNo integer NOT NULL, - nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE, - portId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE, + nodeId char(10) REFERENCES Node(id), + portId char(10) REFERENCES Node(id), vlanId integer, vlanPcp integer, etherType integer, -- cgit v1.2.3