Bug 20691: (QA follow-up) Fix atomic update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Tomás Cohen Arazi 2019-09-10 15:01:34 -03:00 committed by Martin Renvoize
parent 27a1653632
commit 7f8375f009
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 32 additions and 11 deletions

View file

@ -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";
}

View file

@ -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'
)