[open-ils-commits] [GIT] Evergreen ILS branch master updated. 289922394d5567aa47fb672a7f2792c61898483e

Evergreen Git git at git.evergreen-ils.org
Tue Oct 1 17:16:14 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  289922394d5567aa47fb672a7f2792c61898483e (commit)
       via  96c47dc7b8f9392c5d770bd8efff7ab5175495a0 (commit)
      from  ace45349edcd3ef853e1a5b98a24215c5f94d54c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 289922394d5567aa47fb672a7f2792c61898483e
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Tue Oct 1 17:15:36 2019 -0400

    LP#1839002: stamp DB update
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 3e9e1996d2..7b8db1d6f2 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,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 ('1187', :eg_version); -- Dyrcona/gmcharlt
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1188', :eg_version); -- Dyrcona/gmcharlt
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_circulation-auto_renewal-default-false.sql b/Open-ILS/src/sql/Pg/upgrade/1188.schema.action_circulation-auto_renewal-default-false.sql
similarity index 92%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_circulation-auto_renewal-default-false.sql
rename to Open-ILS/src/sql/Pg/upgrade/1188.schema.action_circulation-auto_renewal-default-false.sql
index e5fc738084..67f916c2c8 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_circulation-auto_renewal-default-false.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1188.schema.action_circulation-auto_renewal-default-false.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1188', :eg_version);
 
 UPDATE action.circulation SET auto_renewal = FALSE WHERE auto_renewal IS NULL;
 

commit 96c47dc7b8f9392c5d770bd8efff7ab5175495a0
Author: Jason Stephenson <jason at sigio.com>
Date:   Thu Aug 29 11:06:56 2019 -0400

    Lp 1839002: Default circulation auto_renewal field to FALSE
    
    Change the definition of the action.circulation table so that the
    auto_renewal field is not null, default false.
    
    Add an upgrade script to update the field values and alter the field
    definition in both the action.circulation and action.aged_circulation
    tables.
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql
index e6fe8cd9c4..3fb3b4a782 100644
--- a/Open-ILS/src/sql/Pg/090.schema.action.sql
+++ b/Open-ILS/src/sql/Pg/090.schema.action.sql
@@ -148,7 +148,7 @@ CREATE TABLE action.circulation (
 								   DEFERRABLE INITIALLY DEFERRED,
 	copy_location	INT				NOT NULL DEFAULT 1 REFERENCES asset.copy_location (id) DEFERRABLE INITIALLY DEFERRED,
 	checkin_scan_time   TIMESTAMP WITH TIME ZONE,
-    auto_renewal            BOOLEAN,
+    auto_renewal            BOOLEAN	NOT NULL DEFAULT FALSE,
     auto_renewal_remaining  INTEGER
 ) INHERITS (money.billable_xact);
 ALTER TABLE action.circulation ADD PRIMARY KEY (id);
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_circulation-auto_renewal-default-false.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_circulation-auto_renewal-default-false.sql
new file mode 100644
index 0000000000..e5fc738084
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.action_circulation-auto_renewal-default-false.sql
@@ -0,0 +1,20 @@
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+UPDATE action.circulation SET auto_renewal = FALSE WHERE auto_renewal IS NULL;
+
+UPDATE action.aged_circulation SET auto_renewal = FALSE WHERE auto_renewal IS NULL;
+
+COMMIT;
+
+-- The following two changes cannot occur in a transaction with the
+-- above updates because we will get an error about not being able to
+-- alter a table with pending transactions.  They also need to occur
+-- after the above updates or the SET NOT NULL change will fail.
+
+ALTER TABLE action.circulation ALTER COLUMN auto_renewal SET DEFAULT FALSE;
+ALTER TABLE action.circulation ALTER COLUMN auto_renewal SET NOT NULL;
+
+ALTER TABLE action.aged_circulation ALTER COLUMN auto_renewal SET DEFAULT FALSE;
+ALTER TABLE action.aged_circulation ALTER COLUMN auto_renewal SET NOT NULL;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql            |  2 +-
 Open-ILS/src/sql/Pg/090.schema.action.sql            |  2 +-
 ...action_circulation-auto_renewal-default-false.sql | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/1188.schema.action_circulation-auto_renewal-default-false.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list