make sure asset.call_number.label_sortkey is up to date
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Feb 2011 19:12:49 +0000 (19:12 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Feb 2011 19:12:49 +0000 (19:12 +0000)
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
Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
Open-ILS/src/sql/Pg/upgrade/0492.data.update_cn_label_sortkey.sql [new file with mode: 0644]

index fb6d0c7..4dd05ab 100644 (file)
@@ -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,
index 6fb8039..ad5376d 100644 (file)
@@ -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 (file)
index 0000000..4954e13
--- /dev/null
@@ -0,0 +1,6 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0492'); --miker
+UPDATE asset.call_number SET id = id;
+
+COMMIT;