Adding a trigger. Upgrade # 0364 created the trigger function but not
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Sep 2010 19:16:26 +0000 (19:16 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Sep 2010 19:16:26 +0000 (19:16 +0000)
the trigger itself.  However the base install script 040.schema.asset.sql
creates both the function and the trigger.

M    Open-ILS/src/sql/Pg/002.schema.config.sql
A    Open-ILS/src/sql/Pg/upgrade/0414.schema.call-number-upd-ins-trigger.sql

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17891 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0414.schema.call-number-upd-ins-trigger.sql [new file with mode: 0644]

index fca4b6b..10784c3 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 ('0412'); -- phasefx
+INSERT INTO config.upgrade_log (version) VALUES ('0414'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0414.schema.call-number-upd-ins-trigger.sql b/Open-ILS/src/sql/Pg/upgrade/0414.schema.call-number-upd-ins-trigger.sql
new file mode 100644 (file)
index 0000000..1149898
--- /dev/null
@@ -0,0 +1,13 @@
+BEGIN;
+
+-- Adding a trigger.  Upgrade # 0364 created the trigger function but not
+-- the trigger itself.  However the base install script 040.schema.asset.sql
+-- creates both the function and the trigger.
+
+INSERT INTO config.upgrade_log (version) VALUES ('0414'); -- Scott McKellar
+
+CREATE TRIGGER asset_label_sortkey_trigger
+    BEFORE UPDATE OR INSERT ON asset.call_number
+    FOR EACH ROW EXECUTE PROCEDURE asset.label_normalizer();
+
+COMMIT;