From 2a972f8cb368980bc1722d207564a9dc2f14e091 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 10 Sep 2019 15:01:34 -0300 Subject: [PATCH] Bug 20691: (QA follow-up) Fix atomic update Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug_20691.perl | 32 +++++++++++++++++++ .../data/mysql/atomicupdate/bug_20691.sql | 11 ------- 2 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_20691.perl delete mode 100644 installer/data/mysql/atomicupdate/bug_20691.sql diff --git a/installer/data/mysql/atomicupdate/bug_20691.perl b/installer/data/mysql/atomicupdate/bug_20691.perl new file mode 100644 index 0000000000..41bc517159 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20691.perl @@ -0,0 +1,32 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + + unless ( column_exists( 'borrowers', 'privacy_guarantor_fines' ) ) { + $dbh->do(q{ + ALTER TABLE borrowers + ADD privacy_guarantor_fines TINYINT(1) NOT NULL DEFAULT '0' AFTER privacy; + }); + } + + unless ( column_exists( 'deletedborrowers', 'privacy_guarantor_fines' ) ) { + $dbh->do(q{ + ALTER TABLE deletedborrowers + ADD privacy_guarantor_fines TINYINT(1) NOT NULL DEFAULT '0' AFTER privacy; + }); + } + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type ) + VALUES ( + 'AllowStaffToSetFinesVisibilityForGuarantor', '0', NULL, + 'If enabled, library staff can set a patron''s fines to be visible to linked patrons from the opac.', 'YesNo' + ), ( + 'AllowPatronToSetFinesVisibilityForGuarantor', '0', NULL, + 'If enabled, the patron can set fines to be visible to his or her guarantor', 'YesNo' + ) + }); + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20691 - Add ability for guarantors to view guarantee's fines in OPAC)\n"; +} diff --git a/installer/data/mysql/atomicupdate/bug_20691.sql b/installer/data/mysql/atomicupdate/bug_20691.sql deleted file mode 100644 index 22eb9ed035..0000000000 --- a/installer/data/mysql/atomicupdate/bug_20691.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE borrowers ADD privacy_guarantor_fines BOOLEAN NOT NULL DEFAULT '0' AFTER privacy; -ALTER TABLE deletedborrowers ADD privacy_guarantor_fines BOOLEAN NOT NULL DEFAULT '0' AFTER privacy; - -INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type ) -VALUES ( - 'AllowStaffToSetFinesVisibilityForGuarantor', '0', NULL, - 'If enabled, library staff can set a patron''s fines to be visible to linked patrons from the opac.', 'YesNo' -), ( - 'AllowPatronToSetFinesVisibilityForGuarantor', '0', NULL, - 'If enabled, the patron can set fines to be visible to his or her guarantor', 'YesNo' -) -- 2.23.0