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
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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;
-- 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
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,
-- 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
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;