[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. b3cb7097242725747bcab9f3e286385abbc5c339

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, rel_3_2 has been updated
       via  b3cb7097242725747bcab9f3e286385abbc5c339 (commit)
       via  17d0699927d44771967fa6551ac43b426a9e75c1 (commit)
      from  c233141a4e4c443ded1643fe949039023fc8bb9a (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 b3cb7097242725747bcab9f3e286385abbc5c339
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 c216adc935..2825cdc32f 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 17d0699927d44771967fa6551ac43b426a9e75c1
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 187b88e7d2..e60b17185d 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