From 287c24981f942e25dfb618b848e0a5f519c23e5c Mon Sep 17 00:00:00 2001
From: Mike Rylander <mrylander@gmail.com>
Date: Tue, 10 Jan 2012 15:03:57 -0500
Subject: [PATCH] Stamping upgrade script for in-db hold permit fixups

Signed-off-by: Mike Rylander <mrylander@gmail.com>
---
 Open-ILS/src/sql/Pg/002.schema.config.sql                  |  2 +-
 ...old_permit.sql => 0668.schema.fix_indb_hold_permit.sql} | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 rename Open-ILS/src/sql/Pg/upgrade/{XXXX.fix_indb_hold_permit.sql => 0668.schema.fix_indb_hold_permit.sql} (96%)

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index eaf5c15632..ad239ddbda 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -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 ('0667', :eg_version); -- senator/berick
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0668', :eg_version); -- tsbere/miker
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_indb_hold_permit.sql b/Open-ILS/src/sql/Pg/upgrade/0668.schema.fix_indb_hold_permit.sql
similarity index 96%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.fix_indb_hold_permit.sql
rename to Open-ILS/src/sql/Pg/upgrade/0668.schema.fix_indb_hold_permit.sql
index 35d2ba416c..c26b336699 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix_indb_hold_permit.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0668.schema.fix_indb_hold_permit.sql
@@ -1,3 +1,14 @@
+-- Evergreen DB patch 0668.schema.fix_indb_hold_permit.sql
+--
+-- FIXME: insert description of change, if needed
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0668', :eg_version);
+
+-- FIXME: add/check SQL statements to perform the upgrade
 CREATE OR REPLACE FUNCTION action.hold_request_permit_test( pickup_ou INT, request_ou INT, match_item BIGINT, match_user INT, match_requestor INT, retargetting BOOL ) RETURNS SETOF action.matrix_test_result AS $func$
 DECLARE
     matchpoint_id        INT;
@@ -214,3 +225,6 @@ BEGIN
     RETURN;
 END;
 $func$ LANGUAGE plpgsql;
+
+
+COMMIT;
-- 
2.11.0