Bugzilla – Attachment 101612 Details for
Bug 18177
Remove unused columns in aqbooksellers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18177: Do not remove columns if at least one value exists
Bug-18177-Do-not-remove-columns-if-at-least-one-va.patch (text/plain), 1.46 KB, created by
Jonathan Druart
on 2020-03-24 15:29:20 UTC
(
hide
)
Description:
Bug 18177: Do not remove columns if at least one value exists
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-24 15:29:20 UTC
Size:
1.46 KB
patch
obsolete
>From 5efe8b6da41fe373fdf5917bb0dc0cdfba0e9f64 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 24 Mar 2020 16:22:33 +0100 >Subject: [PATCH] Bug 18177: Do not remove columns if at least one value exists > >--- > installer/data/mysql/atomicupdate/bug_18177.perl | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_18177.perl b/installer/data/mysql/atomicupdate/bug_18177.perl >index 0426fda963..61b0e5e543 100644 >--- a/installer/data/mysql/atomicupdate/bug_18177.perl >+++ b/installer/data/mysql/atomicupdate/bug_18177.perl >@@ -3,10 +3,19 @@ if( CheckVersion( $DBversion ) ) { > > for my $column ( qw(othersupplier booksellerfax booksellerurl bookselleremail currency) ) { > if( column_exists( 'aqbooksellers', $column ) ) { >- $dbh->do(qq| >- ALTER TABLE aqbooksellers >- DROP COLUMN $column >+ my ($count) = $dbh->selectrow_array(qq| >+ SELECT COUNT(*) >+ FROM aqbooksellers >+ WHERE $column IS NOT NULL AND $column <> "" > |); >+ if ( $count ) { >+ warn "Warning - Cannot remove column aqbooksellers.$column. At least one value exists"; >+ } else { >+ $dbh->do(qq| >+ ALTER TABLE aqbooksellers >+ DROP COLUMN $column >+ |); >+ } > } > } > >-- >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 18177
:
100861
|
100862
|
100863
|
100864
|
100865
|
100866
|
100867
|
100868
|
100869
|
100870
|
100871
|
100872
|
100873
|
100874
|
101612
|
101687
|
101688
|
101689
|
101690
|
101691
|
101692
|
101693
|
101694
|
101958
|
101959
|
101960
|
101961
|
101962
|
101963
|
101964
|
101965
|
102011