Bugzilla – Attachment 25575 Details for
Bug 2720
Overdues which debar automatically should undebar automatically when returned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2720 - [Follow-up] Correct database update for debarments with 9999-12-31
0001-Bug-2720-Correct-database-update-for-debarments-with.patch (text/plain), 2.35 KB, created by
Fridolin Somers
on 2014-02-24 11:28:21 UTC
(
hide
)
Description:
Bug 2720 - [Follow-up] Correct database update for debarments with 9999-12-31
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2014-02-24 11:28:21 UTC
Size:
2.35 KB
patch
obsolete
>From 1621d43aec40bfcdf138b9773a97b76dc2fa2bcc Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 24 Feb 2014 12:15:55 +0100 >Subject: [PATCH] Bug 2720 - Correct database update for debarments with > 9999-12-31 > >The borrowers with infinite debarments have borrowers.debarred with '9999-12-31'. >Database update for this bug contained : > INSERT INTO borrower_debarments ( borrowernumber, expiration, comment ) SELECT borrowernumber, debarred, debarredcomment FROM borrowers WHERE debarred IS NOT NULL >For borrowers where borrowers.debarred is '9999-12-31', this value is copied into borrower_debarments.expiration. >This is not correct because borrower_debarments.expiration must be NULL for infinite debarments. > >This patch corrects update 3.13.00.035 and also adds an update for databases already updated. >--- > installer/data/mysql/updatedatabase.pl | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f043d0b..040ec01 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7613,8 +7613,13 @@ CREATE TABLE borrower_debarments ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > }); > >+ # debarments with end date > $dbh->do(q{ >-INSERT INTO borrower_debarments ( borrowernumber, expiration, comment ) SELECT borrowernumber, debarred, debarredcomment FROM borrowers WHERE debarred IS NOT NULL >+INSERT INTO borrower_debarments ( borrowernumber, expiration, comment ) SELECT borrowernumber, debarred, debarredcomment FROM borrowers WHERE debarred IS NOT NULL AND debarred <> '9999-12-31' >+ }); >+ # debarments with no end date >+ $dbh->do(q{ >+INSERT INTO borrower_debarments ( borrowernumber, comment ) SELECT borrowernumber, debarredcomment FROM borrowers WHERE debarred = '9999-12-31' > }); > > $dbh->do(q{ >@@ -7953,6 +7958,15 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ >+ UPDATE borrower_debarments SET debarred WHERE debarred = '9999-12-31' >+ }); >+ print "Upgrade to $DBversion done (Bug 2720 - correct debarments with 9999-12-31)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.8.3.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2720
:
15045
|
15050
|
15051
|
15052
|
16669
|
18213
|
19401
|
19414
|
19418
|
19419
|
19420
|
19421
|
19755
|
20655
|
20656
|
20657
|
20658
|
21366
|
21367
|
21368
|
21369
|
21405
|
21406
|
21407
|
21408
|
21409
|
21410
|
25575
|
25578