added python-ldap requirement
[plcapi.git] / planetlab5.sql
index 1ae9aef..522b8fd 100644 (file)
@@ -50,6 +50,20 @@ CREATE AGGREGATE array_accum (
     initcond = '{}'
 );
 
+--------------------------------------------------------------------------------
+-- Roles
+--------------------------------------------------------------------------------
+
+-- Valid account roles
+CREATE TABLE roles (
+    role_id integer PRIMARY KEY,                       -- Role identifier
+    name text UNIQUE NOT NULL                          -- Role symbolic name
+) WITH OIDS;
+INSERT INTO roles (role_id, name) VALUES (10, 'admin');
+INSERT INTO roles (role_id, name) VALUES (20, 'pi');
+INSERT INTO roles (role_id, name) VALUES (30, 'user');
+INSERT INTO roles (role_id, name) VALUES (40, 'tech');
+
 --------------------------------------------------------------------------------
 -- The building block for attaching tags
 --------------------------------------------------------------------------------
@@ -97,7 +111,7 @@ CREATE INDEX persons_email_idx ON persons (email);
 --------------------------------------------------------------------------------
 CREATE TABLE person_tag (
     person_tag_id serial PRIMARY KEY,                  -- ID
-    person_id integer REFERENCES persons NOT NULL,             -- person id
+    person_id integer REFERENCES persons NOT NULL,     -- person id
     tag_type_id integer REFERENCES tag_types,          -- tag type id
     value text                                         -- value attached
 ) WITH OIDS;
@@ -308,16 +322,6 @@ GROUP BY person_id;
 -- Account roles
 --------------------------------------------------------------------------------
 
--- Valid account roles
-CREATE TABLE roles (
-    role_id integer PRIMARY KEY,                       -- Role identifier
-    name text UNIQUE NOT NULL                          -- Role symbolic name
-) WITH OIDS;
-INSERT INTO roles (role_id, name) VALUES (10, 'admin');
-INSERT INTO roles (role_id, name) VALUES (20, 'pi');
-INSERT INTO roles (role_id, name) VALUES (30, 'user');
-INSERT INTO roles (role_id, name) VALUES (40, 'tech');
-
 CREATE TABLE person_role (
     person_id integer REFERENCES persons NOT NULL,     -- Account identifier
     role_id integer REFERENCES roles NOT NULL,         -- Role identifier
@@ -383,7 +387,7 @@ CREATE TABLE nodes (
     version text,                                      -- Boot CD version string updated by Boot Manager
     ssh_rsa_key text,                                  -- SSH host key updated by Boot Manager
     key text,                                          -- Node key generated when boot file is downloaded
-       verified boolean NOT NULL DEFAULT false,                -- whether or not the node & pcu are verified
+       verified boolean NOT NULL DEFAULT false,        -- whether or not the node & pcu are verified
 
     -- Timestamps
     date_created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -811,7 +815,7 @@ GROUP BY node_id;
 
 -- Slice/sliver attributes
 CREATE TABLE slice_tag (
-    slice_tag_id serial PRIMARY KEY,           -- Slice attribute identifier
+    slice_tag_id serial PRIMARY KEY,                   -- Slice attribute identifier
     slice_id integer REFERENCES slices NOT NULL,       -- Slice identifier
     node_id integer REFERENCES nodes,                  -- Sliver attribute if set
     nodegroup_id integer REFERENCES nodegroups,                -- Node group attribute if set
@@ -849,7 +853,7 @@ CREATE TABLE peers (
     cacert text,                                       -- (SSL) Public certificate of peer API server
     key text,                                          -- (GPG) Public key used for authentication
     shortname text,                                    -- abbreviated name for displaying foreign objects
-    hrn_root text,                                             -- root for this peer domain
+    hrn_root text,                                     -- root for this peer domain
     deleted boolean NOT NULL DEFAULT false
 ) WITH OIDS;
 CREATE INDEX peers_peername_idx ON peers (peername) WHERE deleted IS false;