make root the default creator of conf_files, conf_files.site_id can be Null
authorTony Mack <tmack@cs.princeton.edu>
Wed, 22 Oct 2008 20:49:11 +0000 (20:49 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Wed, 22 Oct 2008 20:49:11 +0000 (20:49 +0000)
migrations/010-up-slice-conf_file.sql
planetlab4.sql

index 70a6680..1391cf0 100644 (file)
@@ -1,6 +1,6 @@
-ALTER TABLE conf_files ADD site_id integer NOT NULL REFERENCES sites;
-ALTER TABLE conf_files ADD creator_id integer NOT NULL REFERENCES persons;
-ALTER TABLE conf_files ADD last_modified_by_id integer NOT NULL REFERENCES persons;
+ALTER TABLE conf_files ADD site_id integer REFERENCES sites;
+ALTER TABLE conf_files ADD creator_id integer NOT NULL DEFAULT 1 REFERENCES persons;
+ALTER TABLE conf_files ADD last_modified_by_id integer NOT NULL DEFAULT 1 REFERENCES persons;
 ALTER TABLE conf_files ADD date_created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP;
 ALTER TABLE conf_files ADD last_modified timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP;
 
index e71c067..22748fb 100644 (file)
@@ -348,9 +348,9 @@ CREATE TABLE conf_files (
     error_cmd text, -- Shell command to execute if any error occurs
     ignore_cmd_errors bool NOT NULL DEFAULT false, -- Install file anyway even if an error occurs
     always_update bool NOT NULL DEFAULT false -- Always attempt to install file even if unchanged
-    site_id integer NOT NULL REFERENCES sites,         -- Site identifier 
-    creator_id integer NOT NULL REFERENCES persons,  -- Person id of whoever created this file
-    last_modified_by_id integer NOT NULL REFERENCES persons,  -- Person id of whoever last updated this file
+    site_id integer REFERENCES sites,  -- Site identifier 
+    creator_id integer NOT NULL DEFAULT 1 REFERENCES persons,  -- Person id of whoever created this file
+    last_modified_by_id integer NOT NULL DEFAULT 1 REFERENCES persons,  -- Person id of whoever last updated this file
     date_created timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,  -- Date this file was created
     last_modified timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP  -- Date this file was last modified
 ) WITH OIDS;