- added 'object_type' field to events table
[plcapi.git] / planetlab4.sql
index d3890ae..9678193 100644 (file)
@@ -9,7 +9,7 @@
 --
 -- Copyright (C) 2006 The Trustees of Princeton University
 --
--- $Id: planetlab4.sql,v 1.57 2007/01/09 16:13:36 mlhuang Exp $
+-- $Id: planetlab4.sql,v 1.62 2007/01/16 17:03:01 mlhuang Exp $
 --
 
 --------------------------------------------------------------------------------
@@ -226,10 +226,6 @@ 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');
-INSERT INTO roles (role_id, name) VALUES (1000, 'node');
-INSERT INTO roles (role_id, name) VALUES (2000, 'anonymous');
--- xxx not sure this us useful yet
---INSERT INTO roles (role_id, name) VALUES (3000, 'peer');
 
 CREATE TABLE person_role (
     person_id integer REFERENCES persons NOT NULL, -- Account identifier
@@ -757,6 +753,7 @@ CREATE TABLE events (
     fault_code integer NOT NULL DEFAULT 0, -- Did this event result in error
     call_name text NOT NULL, -- Call responsible for this event
     call text NOT NULL, -- Call responsible for this event, including parameters
+    object_type text, -- What type of object is this event affecting
     message text, -- High level description of this event
     runtime float DEFAULT 0, -- Event run time
     time timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP -- Event timestamp
@@ -805,7 +802,7 @@ persons.deleted,
 persons.enabled,
 persons.password,
 persons.verification_key,
-persons.verification_expires,
+CAST(date_part('epoch', persons.verification_expires) AS bigint) AS verification_expires,
 persons.title,
 persons.phone,
 persons.url,