From d5043efbad49eef4b723567d27b6094b02d5e663 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 7 Sep 2011 14:27:05 -0400 Subject: [PATCH] Cleanup, yay! Give YAOUS logging table a surrogate pkey and upgrade script; clean up some typos; position the existing upgrade script correctly Signed-off-by: Mike Rylander Signed-off-by: Thomas Berezansky Signed-off-by: Jason Etheridge --- Open-ILS/examples/fm_IDL.xml | 11 ++++++----- Open-ILS/src/sql/Pg/002.schema.config.sql | 5 +++-- Open-ILS/src/sql/Pg/800.fkeys.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 2 +- ...s-group update.sql => XXXX.data.YAOUS-i18n-update.sql} | 2 +- .../src/sql/Pg/upgrade/XXXX.schema.YAOUS-log-table.sql | 15 +++++++++++++++ 6 files changed, 27 insertions(+), 10 deletions(-) rename Open-ILS/src/sql/Pg/upgrade/{9999.data-seed-values-group update.sql => XXXX.data.YAOUS-i18n-update.sql} (99%) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.YAOUS-log-table.sql diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 2c1c1862a4..8c587e306b 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -9159,9 +9159,10 @@ SELECT usr, - + + - + @@ -9172,10 +9173,10 @@ SELECT usr, - + - - + + diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 6f61662e1e..53e0ba52fd 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -917,8 +917,9 @@ 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), + id BIGSERIAL PRIMARY KEY, + date_applied TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), + org INT, --REFERENCES actor.org_unit (id), original_value TEXT, new_value TEXT, field_name TEXT REFERENCES config.org_unit_setting_type (name) diff --git a/Open-ILS/src/sql/Pg/800.fkeys.sql b/Open-ILS/src/sql/Pg/800.fkeys.sql index 224ca4a9af..53be2e1a9e 100644 --- a/Open-ILS/src/sql/Pg/800.fkeys.sql +++ b/Open-ILS/src/sql/Pg/800.fkeys.sql @@ -124,6 +124,6 @@ CREATE INDEX by_heading ON authority.record_entry (authority.simple_normalize_he ALTER TABLE config.z3950_source ADD CONSTRAINT use_perm_fkey FOREIGN KEY (use_perm) REFERENCES permission.perm_list (id) ON UPDATE CASCADE ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED; -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; +ALTER TABLE config.org_unit_setting_type_log ADD CONSTRAINT config_org_unit_setting_type_log_fkey FOREIGN KEY (org) REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED; COMMIT; diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 1e9d908273..af06103954 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -6179,7 +6179,7 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES ( 'circ.holds.uncancel.reset_request_time', oils_i18n_gettext('circ.holds.uncancel.reset_request_time', 'Reset request time on un-cancel','coust', 'label'), - oils_i18n_gettext('circ.holds.uncancel.reset_request_time', 'When a hold is uncanceled, reset the request time to push it to the end of the queue',- 'coust', 'description'), + oils_i18n_gettext('circ.holds.uncancel.reset_request_time', 'When a hold is uncanceled, reset the request time to push it to the end of the queue', 'coust', 'description'), 'bool' ); diff --git a/Open-ILS/src/sql/Pg/upgrade/9999.data-seed-values-group update.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.YAOUS-i18n-update.sql similarity index 99% rename from Open-ILS/src/sql/Pg/upgrade/9999.data-seed-values-group update.sql rename to Open-ILS/src/sql/Pg/upgrade/XXXX.data.YAOUS-i18n-update.sql index 3084d1c87c..35886226ba 100644 --- a/Open-ILS/src/sql/Pg/upgrade/9999.data-seed-values-group update.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.YAOUS-i18n-update.sql @@ -3,7 +3,7 @@ -- BEGIN; -INSERT INTO config.upgrade_log (version) VALUES ('9999'); +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); UPDATE config.org_unit_setting_type SET label = oils_i18n_gettext('circ.holds.behind_desk_pickup_supported', 'Behind Desk Pickup Supported', 'coust', 'label') WHERE name = 'circ.holds.behind_desk_pickup_supported'; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.YAOUS-log-table.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.YAOUS-log-table.sql new file mode 100644 index 0000000000..4ce1c9d9f2 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.YAOUS-log-table.sql @@ -0,0 +1,15 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + + +CREATE TABLE config.org_unit_setting_type_log ( + id BIGSERIAL PRIMARY KEY, + date_applied TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), + org INT REFERENCES actor.org_unit (id), + original_value TEXT, + new_value TEXT, + field_name TEXT REFERENCES config.org_unit_setting_type (name) +); + +COMMIT; -- 2.11.0