Bugzilla – Attachment 110839 Details for
Bug 26268
Remove items.paid for once and for all
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26268: (QA follow-up) Conditionally remove
Bug-26268-QA-follow-up-Conditionally-remove.patch (text/plain), 2.58 KB, created by
Martin Renvoize (ashimema)
on 2020-09-28 09:19:21 UTC
(
hide
)
Description:
Bug 26268: (QA follow-up) Conditionally remove
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-09-28 09:19:21 UTC
Size:
2.58 KB
patch
obsolete
>From 9d003f8be2816678322b35479270701b88c8629b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 11 Sep 2020 12:51:47 +0100 >Subject: [PATCH] Bug 26268: (QA follow-up) Conditionally remove > >This patch adds conditions to prevent the removal of items.paidfor if it >is populated and also adds the removal fo the marc_subfield_structure >row if it exists. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../data/mysql/atomicupdate/bug_26268.perl | 42 ++++++++++++++++--- > 1 file changed, 36 insertions(+), 6 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_26268.perl b/installer/data/mysql/atomicupdate/bug_26268.perl >index a5769225e4..c45dc65ddf 100644 >--- a/installer/data/mysql/atomicupdate/bug_26268.perl >+++ b/installer/data/mysql/atomicupdate/bug_26268.perl >@@ -1,13 +1,43 @@ >-$DBversion = 'XXX'; # will be replaced by the RM >-if( CheckVersion( $DBversion ) ) { >+$DBversion = 'XXX'; # will be replaced by the RM >+if ( CheckVersion($DBversion) ) { > >- if( column_exists( 'items', 'paidfor' ) ) { >- $dbh->do(q|ALTER TABLE items DROP COLUMN paidfor|); >+ if ( column_exists( 'items', 'paidfor' ) ) { >+ my ($count) = $dbh->selectrow_array( >+ qq| >+ SELECT COUNT(*) >+ FROM items >+ WHERE paidfor IS NOT NULL AND paidfor <> "" >+ | >+ ); >+ if ($count) { >+ warn "Warning - Cannot remove column items.paidfor. At least one value exists"; >+ } >+ else { >+ $dbh->do(q|ALTER TABLE items DROP COLUMN paidfor|); >+ $dbh->do(q| >+ DELETE FROM marc_subfield_structure >+ WHERE tagfield = '952' >+ AND tagsubfield = 'x' >+ AND kohafield = 'items.paidfor' >+ |); >+ } > } > > if ( column_exists( 'deleteditems', 'paidfor' ) ) { >- $dbh->do(q|ALTER TABLE deleteditems DROP COLUMN paidfor|); >+ my ($count) = $dbh->selectrow_array( >+ qq| >+ SELECT COUNT(*) >+ FROM items >+ WHERE paidfor IS NOT NULL AND paidfor <> "" >+ | >+ ); >+ if ($count) { >+ warn "Warning - Cannot remove column deleteditems.paidfor. At least one value exists"; >+ } >+ else { >+ $dbh->do(q|ALTER TABLE deleteditems DROP COLUMN paidfor|); >+ } > } > >- NewVersion( $DBversion, 26268, "Remove items.paidfor field"); >+ NewVersion( $DBversion, 26268, "Remove items.paidfor field" ); > } >-- >2.20.1
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 26268
:
108797
|
108799
|
108807
|
108808
|
108809
|
108810
|
108812
|
108813
|
108814
|
109674
|
109675
|
109676
|
109677
|
109930
|
109931
|
109932
|
109933
|
109934
|
110801
|
110802
|
110803
|
110804
|
110805
|
110806
|
110836
|
110837
|
110838
| 110839 |
110840
|
110841
|
110935