From 28bff435d0a8590529e95adfbfb2921f7007e63e Mon Sep 17 00:00:00 2001 From: Joseph Lewis Date: Mon, 20 Jun 2011 13:36:25 -0600 Subject: [PATCH] Fixed my database errors (although some still exist, I can't tell if they are mine or not, I'm going to test the master and see if they exist there...) Signed-off-by: Joseph Lewis --- Open-ILS/src/sql/Pg/002.schema.config.sql | 4 ++-- Open-ILS/src/sql/Pg/800.fkeys.sql | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 1e1e0db28d..a5b2e724e1 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -912,13 +912,13 @@ CREATE TYPE evergreen.barcode_set AS (type TEXT, id BIGINT, barcode TEXT); CREATE TABLE config.org_unit_setting_type_log ( date_applied TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() PRIMARY KEY, - org SERIAL REFERENCES actor.org_unit (id), + org SERIAL, --REFERENCES actor.org_unit (id), original_value TEXT, new_value TEXT, field_name TEXT REFERENCES config.org_unit_setting_type (name) ); -COMMENT ON TABLE config.org_unit_setting_log IS $$ +COMMENT ON TABLE config.org_unit_setting_type_log IS $$ Org Unit setting Logs This table contains the most recent changes to each setting diff --git a/Open-ILS/src/sql/Pg/800.fkeys.sql b/Open-ILS/src/sql/Pg/800.fkeys.sql index d0ee8877c2..2e12333ac3 100644 --- a/Open-ILS/src/sql/Pg/800.fkeys.sql +++ b/Open-ILS/src/sql/Pg/800.fkeys.sql @@ -119,4 +119,6 @@ ALTER TABLE config.barcode_completion ADD CONSTRAINT config_barcode_completion_o CREATE INDEX by_heading_and_thesaurus ON authority.record_entry (authority.normalize_heading(marc)) WHERE deleted IS FALSE or deleted = FALSE; +ALTER TABLE config.org_unit_setting_type_log ADD CONSTRAINT config_org_unit_setting_type_log_fkey FORIEGN KEY (org) REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED; + COMMIT; -- 2.11.0