Apply all 2.2 upgrades prior to running 2.3.0 upgrade
authorDan Scott <dscott@laurentian.ca>
Tue, 29 Jan 2013 16:04:33 +0000 (11:04 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 15 May 2013 19:43:14 +0000 (15:43 -0400)
If users are expected to run all of the 2.2 upgrade scripts, then let's
make it easy for them. As PostgreSQL 9.1 does not include the \ir
"include relative path" command, we have to pause at the beginning of
the upgrade process to ensure that the user is running the script from
the right directory.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/sql/Pg/version-upgrade/2.2-2.3.0-upgrade-db.sql

index a6cfd9a..911b14d 100644 (file)
@@ -2,6 +2,14 @@
 
 \set eg_version '''2.3.0'''
 
+\qecho **********************************************************************
+\qecho Your current working directory when you run this script *must* be
+\qecho Open-ILS/src/sql/Pg/version-upgrade/ or it will fail to find the point
+\qecho release upgrade scripts. Press <ENTER> to continue, or hit <CTRL-C> to
+\qecho prevent the upgrade from happening.
+\qecho **********************************************************************
+\prompt chance-to-quit
+
 \qecho The following statement might fail, and that is okay; we are
 \qecho ensuring that an upgrade that should have been applied during
 \qecho the 2.2 upgrade is actually applied now.
@@ -14,7 +22,18 @@ UPDATE config.org_unit_setting_type
     SET grp = 'acq'
     WHERE name LIKE 'acq%';
 
+\qecho Apply previous point release upgrades to ensure that all known fixes are
+\qecho in place. Failures here will generally indicate that the fixes were
+\qecho already applied.
+
+\i 2.2.0-2.2.1-upgrade-db.sql
+\i 2.2.1-2.2.2-upgrade-db.sql
+\i 2.2.2-2.2.3-upgrade-db.sql
+\i 2.2.3-2.2.4-upgrade-db.sql
+\i 2.2.4-2.2.5-upgrade-db.sql
+
 \qecho The real upgrade begins now.
+\set eg_version '''2.3.0'''
 
 BEGIN;
 INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.3.0', :eg_version);
@@ -910,7 +929,6 @@ BEGIN
 END;
 $func$ LANGUAGE plpgsql;
 
-
 -- Evergreen DB patch 0727.function.xml_pretty_print.sql
 --
 -- A simple pretty printer for XML.