From: Tony Mack Date: Wed, 8 Aug 2007 19:50:40 +0000 (+0000) Subject: - create whitelist table/view after slices table is created because whitelist need... X-Git-Tag: PLCAPI-4.2-0~94 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c7b7fb7f13aaa1da283f02ad5a20293746508b8c;p=plcapi.git - create whitelist table/view after slices table is created because whitelist need to reference slices --- diff --git a/planetlab4.sql b/planetlab4.sql index 2f47d015..e657946d 100644 --- a/planetlab4.sql +++ b/planetlab4.sql @@ -9,7 +9,7 @@ -- -- Copyright (C) 2006 The Trustees of Princeton University -- --- $Id: planetlab4.sql,v 1.79 2007/07/12 17:48:19 tmack Exp $ +-- $Id: planetlab4.sql,v 1.80 2007/08/01 17:01:01 tmack Exp $ -- SET client_encoding = 'UNICODE'; @@ -296,22 +296,6 @@ FROM nodes WHERE deleted IS false GROUP BY site_id; --- slice whitelist on nodes -CREATE TABLE node_slice_whitelist ( - node_id integer REFERENCES nodes NOT NULL, -- Node id of whitelist - slice_id integer REFERENCES slices NOT NULL, -- Slice id thats allowd on this node - PRIMARY KEY (node_id, slice_id) -) WITH OIDS; -CREATE INDEX node_slice_whitelist_node_id_idx ON node_slice_whitelist (node_id); -CREATE INDEX node_slice_whitelist_slice_id_idx ON node_slice_whitelist (slice_id); - --- Slices on each node -CREATE VIEW node_slices_whitelist AS -SELECT node_id, -array_accum(slice_id) AS slice_ids_whitelist -FROM node_slice_whitelist -GROUP BY node_id; - -------------------------------------------------------------------------------- -- Node groups -------------------------------------------------------------------------------- @@ -607,6 +591,25 @@ array_accum(slice_id) AS slice_ids FROM slice_person GROUP BY person_id; +-------------------------------------------------------------------------------- +-- Slice whitelist +-------------------------------------------------------------------------------- +-- slice whitelist on nodes +CREATE TABLE node_slice_whitelist ( + node_id integer REFERENCES nodes NOT NULL, -- Node id of whitelist + slice_id integer REFERENCES slices NOT NULL, -- Slice id thats allowd on this node + PRIMARY KEY (node_id, slice_id) +) WITH OIDS; +CREATE INDEX node_slice_whitelist_node_id_idx ON node_slice_whitelist (node_id); +CREATE INDEX node_slice_whitelist_slice_id_idx ON node_slice_whitelist (slice_id); + +-- Slices on each node +CREATE VIEW node_slices_whitelist AS +SELECT node_id, +array_accum(slice_id) AS slice_ids_whitelist +FROM node_slice_whitelist +GROUP BY node_id; + -------------------------------------------------------------------------------- -- Slice attributes --------------------------------------------------------------------------------