- remove NOT NULL constraint from slices.creator_person_id in case
authorMark Huang <mlhuang@cs.princeton.edu>
Wed, 31 Jan 2007 19:54:42 +0000 (19:54 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Wed, 31 Jan 2007 19:54:42 +0000 (19:54 +0000)
  creator is deleted
- ensure that encoding is UNICODE
- make plc_db_version.subversion part of the schema, and bump to 2

planetlab4.sql

index 93a4554..05840cc 100644 (file)
@@ -9,9 +9,11 @@
 --
 -- Copyright (C) 2006 The Trustees of Princeton University
 --
--- $Id: planetlab4.sql,v 1.68 2007/01/30 11:27:12 thierry Exp $
+-- $Id: planetlab4.sql,v 1.69 2007/01/30 23:06:54 mlhuang Exp $
 --
 
+SET client_encoding = 'UNICODE';
+
 --------------------------------------------------------------------------------
 -- Aggregates and store procedures
 --------------------------------------------------------------------------------
@@ -31,11 +33,11 @@ CREATE AGGREGATE array_accum (
 
 -- Database version
 CREATE TABLE plc_db_version (
-       version integer NOT NULL 
--- subversion created on demand by plc.d/db
+    version integer NOT NULL,
+    subversion integer NOT NULL DEFAULT 0
 ) WITH OIDS;
 
-INSERT INTO plc_db_version (version) VALUES (4);
+INSERT INTO plc_db_version (version) VALUES (4, 2);
 
 --------------------------------------------------------------------------------
 -- Accounts
@@ -518,7 +520,7 @@ CREATE TABLE slices (
 
     max_nodes integer NOT NULL DEFAULT 100, -- Maximum number of nodes that can be assigned to this slice
 
-    creator_person_id integer REFERENCES persons NOT NULL, -- Creator
+    creator_person_id integer REFERENCES persons, -- Creator
     created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, -- Creation date
     expires timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP + '2 weeks', -- Expiration date