Bugzilla – Attachment 59806 Details for
Bug 14224
patron notes about item shown at check in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14224: Check if the columns do not exist before creating them
Bug-14224-Check-if-the-columns-do-not-exist-before.patch (text/plain), 2.49 KB, created by
Josef Moravec
on 2017-02-02 11:44:59 UTC
(
hide
)
Description:
Bug 14224: Check if the columns do not exist before creating them
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-02-02 11:44:59 UTC
Size:
2.49 KB
patch
obsolete
>From f478478dec909db37a24e6499ccb42f98462f2af Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 1 Feb 2017 15:53:06 +0100 >Subject: [PATCH] Bug 14224: Check if the columns do not exist before creating > them > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > .../atomicupdate/bug_14224-add_new_issue_columns.perl | 18 ++++++++++++++++++ > .../atomicupdate/bug_14224-add_new_issue_columns.sql | 4 ---- > 2 files changed, 18 insertions(+), 4 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.perl > delete mode 100644 installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.perl b/installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.perl >new file mode 100644 >index 0000000..eaf8a98 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.perl >@@ -0,0 +1,18 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ unless( column_exists( 'issues', 'note' ) ) { >+ $dbh->do(q|ALTER TABLE issues ADD note mediumtext default NULL AFTER onsite_checkout|); >+ } >+ unless( column_exists( 'issues', 'notedate' ) ) { >+ $dbh->do(q|ALTER TABLE issues ADD notedate datetime default NULL AFTER note|); >+ } >+ unless( column_exists( 'old_issues', 'note' ) ) { >+ $dbh->do(q|ALTER TABLE old_issues ADD note mediumtext default NULL AFTER onsite_checkout|); >+ } >+ unless( column_exists( 'old_issues', 'notedate' ) ) { >+ $dbh->do(q|ALTER TABLE old_issues ADD notedate datetime default NULL AFTER note|); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 14224: Add column issues.note and issues.notedate)\n"; >+} >diff --git a/installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.sql b/installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.sql >deleted file mode 100644 >index 6ed41dc..0000000 >--- a/installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.sql >+++ /dev/null >@@ -1,4 +0,0 @@ >-ALTER IGNORE TABLE issues ADD `note` mediumtext default NULL AFTER `onsite_checkout`; >-ALTER IGNORE TABLE issues ADD `notedate` datetime default NULL AFTER `note`; >-ALTER IGNORE TABLE old_issues ADD `note` mediumtext default NULL AFTER `onsite_checkout`; >-ALTER IGNORE TABLE old_issues ADD `notedate` datetime default NULL AFTER `note`; >-- >2.1.4
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 14224
:
41801
|
41921
|
56682
|
57440
|
57577
|
57763
|
57802
|
57829
|
57853
|
58277
|
58325
|
58326
|
58372
|
58606
|
58622
|
59469
|
59637
|
59641
|
59761
|
59779
|
59780
|
59781
|
59782
|
59783
|
59784
|
59785
|
59786
|
59787
|
59788
|
59796
|
59798
|
59799
|
59800
|
59801
|
59802
|
59803
|
59804
|
59805
|
59806
|
61847
|
61848
|
61849
|
61850
|
61851
|
61852
|
61853
|
61854
|
61855
|
61856
|
62196
|
62197
|
62198
|
62199
|
62200
|
62201
|
62202
|
62203
|
62204
|
62205
|
62206
|
62633
|
62634
|
62635
|
62636
|
62637
|
62638
|
62639
|
62640
|
62641
|
62642
|
62643
|
62644