From 1308811725e7fd4ba336d607ef534db40de8528d Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 25 Feb 2011 19:12:49 +0000 Subject: [PATCH] make sure asset.call_number.label_sortkey is up to date git-svn-id: svn://svn.open-ils.org/ILS/trunk@19540 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql | 3 +++ Open-ILS/src/sql/Pg/upgrade/0492.data.update_cn_label_sortkey.sql | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0492.data.update_cn_label_sortkey.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index fb6d0c7fda..4dd05ab3bf 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -70,7 +70,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0491'); -- dbwells +INSERT INTO config.upgrade_log (version) VALUES ('0492'); -- miker CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql index 6fb8039f29..ad5376d54e 100644 --- a/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql +++ b/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql @@ -18876,6 +18876,9 @@ CREATE TRIGGER asset_label_sortkey_trigger BEFORE UPDATE OR INSERT ON asset.call_number FOR EACH ROW EXECUTE PROCEDURE asset.label_normalizer(); +-- Now populate the label_sortkey column via the trigger +UPDATE asset.call_number SET id = id; + CREATE OR REPLACE FUNCTION container.clear_all_expired_circ_history_items( ) RETURNS VOID AS $$ -- diff --git a/Open-ILS/src/sql/Pg/upgrade/0492.data.update_cn_label_sortkey.sql b/Open-ILS/src/sql/Pg/upgrade/0492.data.update_cn_label_sortkey.sql new file mode 100644 index 0000000000..4954e13c6e --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0492.data.update_cn_label_sortkey.sql @@ -0,0 +1,6 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0492'); --miker +UPDATE asset.call_number SET id = id; + +COMMIT; -- 2.11.0