(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.
This commit is contained in:
@@ -77,8 +77,8 @@ CREATE INDEX Relay_networkId ON Relay (networkId);
|
|||||||
CREATE TABLE Rule (
|
CREATE TABLE Rule (
|
||||||
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
||||||
ruleNo integer NOT NULL,
|
ruleNo integer NOT NULL,
|
||||||
nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,
|
nodeId char(10) REFERENCES Node(id),
|
||||||
portId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,
|
portId char(10) REFERENCES Node(id),
|
||||||
vlanId integer,
|
vlanId integer,
|
||||||
vlanPcp integer,
|
vlanPcp integer,
|
||||||
etherType integer,
|
etherType integer,
|
||||||
|
|||||||
@@ -78,8 +78,8 @@
|
|||||||
"CREATE TABLE Rule (\n"\
|
"CREATE TABLE Rule (\n"\
|
||||||
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
||||||
" ruleNo integer NOT NULL,\n"\
|
" ruleNo integer NOT NULL,\n"\
|
||||||
" nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,\n"\
|
" nodeId char(10) REFERENCES Node(id),\n"\
|
||||||
" portId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,\n"\
|
" portId char(10) REFERENCES Node(id),\n"\
|
||||||
" vlanId integer,\n"\
|
" vlanId integer,\n"\
|
||||||
" vlanPcp integer,\n"\
|
" vlanPcp integer,\n"\
|
||||||
" etherType integer,\n"\
|
" etherType integer,\n"\
|
||||||
|
|||||||
Reference in New Issue
Block a user