From 8b3686febd84052dbbe10780bc4ad031edb3e81b Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 22 Oct 2008 20:49:11 +0000 Subject: [PATCH] make root the default creator of conf_files, conf_files.site_id can be Null --- migrations/010-up-slice-conf_file.sql | 6 +++--- planetlab4.sql | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/migrations/010-up-slice-conf_file.sql b/migrations/010-up-slice-conf_file.sql index 70a66808..1391cf01 100644 --- a/migrations/010-up-slice-conf_file.sql +++ b/migrations/010-up-slice-conf_file.sql @@ -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; diff --git a/planetlab4.sql b/planetlab4.sql index e71c067a..22748fb0 100644 --- a/planetlab4.sql +++ b/planetlab4.sql @@ -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; -- 2.47.0