Stamping for LP821404 au last_update_time
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 8 Sep 2011 19:55:42 +0000 (15:55 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Thu, 8 Sep 2011 19:55:42 +0000 (15:55 -0400)
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0619.schema.au_last_update_time.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.au_last_update_date.sql [deleted file]

index bc00d9b..eb0c6d0 100644 (file)
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0618', :eg_version); -- phasefx/tsbere
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0619', :eg_version); -- tsbere/phasefx
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0619.schema.au_last_update_time.sql b/Open-ILS/src/sql/Pg/upgrade/0619.schema.au_last_update_time.sql
new file mode 100644 (file)
index 0000000..d06d552
--- /dev/null
@@ -0,0 +1,28 @@
+-- Evergreen DB patch 0619.schema.au_last_update_time.sql
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0619', :eg_version);
+
+-- Add new column last_update_time to actor.usr, with trigger to maintain it
+-- Add corresponding new column to auditor.actor_usr_history
+
+ALTER TABLE actor.usr
+       ADD COLUMN last_update_time TIMESTAMPTZ;
+
+ALTER TABLE auditor.actor_usr_history
+       ADD COLUMN last_update_time TIMESTAMPTZ;
+
+CREATE OR REPLACE FUNCTION actor.au_updated()
+RETURNS TRIGGER AS $$
+BEGIN
+    NEW.last_update_time := now();
+       RETURN NEW;
+END;
+$$ LANGUAGE plpgsql;
+
+CREATE TRIGGER au_update_trig
+       BEFORE INSERT OR UPDATE ON actor.usr
+       FOR EACH ROW EXECUTE PROCEDURE actor.au_updated();
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.au_last_update_date.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.au_last_update_date.sql
deleted file mode 100644 (file)
index 739a6c7..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
--- Evergreen DB patch XXXX.schema.au_last_update_time.sql
-BEGIN;
-
--- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
--- Add new column last_update_time to actor.usr, with trigger to maintain it
--- Add corresponding new column to auditor.actor_usr_history
-
-ALTER TABLE actor.usr
-       ADD COLUMN last_update_time TIMESTAMPTZ;
-
-ALTER TABLE auditor.actor_usr_history
-       ADD COLUMN last_update_time TIMESTAMPTZ;
-
-CREATE OR REPLACE FUNCTION actor.au_updated()
-RETURNS TRIGGER AS $$
-BEGIN
-    NEW.last_update_time := now();
-       RETURN NEW;
-END;
-$$ LANGUAGE plpgsql;
-
-CREATE TRIGGER au_update_trig
-       BEFORE INSERT OR UPDATE ON actor.usr
-       FOR EACH ROW EXECUTE PROCEDURE actor.au_updated();
-
-COMMIT;