From b492182b69e353f4f08d227b1ec7525a23bd6fe0 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 27 Apr 2017 19:10:47 +0000 Subject: [PATCH] Bug 14224 - DBRev 16.12.00.029 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- .../bug_14224-add_new_issue_columns.perl | 18 ------------ ...bug_14224-add_patron_notice_to_letters.sql | 1 - .../bug_14224-issue_notes_syspref.sql | 1 - installer/data/mysql/updatedatabase.pl | 29 +++++++++++++++++++ 5 files changed, 30 insertions(+), 21 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.perl delete mode 100644 installer/data/mysql/atomicupdate/bug_14224-add_patron_notice_to_letters.sql delete mode 100644 installer/data/mysql/atomicupdate/bug_14224-issue_notes_syspref.sql diff --git a/Koha.pm b/Koha.pm index 07489a92e9..056b8a48a5 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "16.12.00.028"; +$VERSION = "16.12.00.029"; sub version { return $VERSION; 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 deleted file mode 100644 index eaf8a983fa..0000000000 --- a/installer/data/mysql/atomicupdate/bug_14224-add_new_issue_columns.perl +++ /dev/null @@ -1,18 +0,0 @@ -$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_patron_notice_to_letters.sql b/installer/data/mysql/atomicupdate/bug_14224-add_patron_notice_to_letters.sql deleted file mode 100644 index 135887eb69..0000000000 --- a/installer/data/mysql/atomicupdate/bug_14224-add_patron_notice_to_letters.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT IGNORE INTO letter (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation', 'PATRON_NOTE', '', 'Patron note on item', '0', 'Patron issue note', '<> <> has added a note to the item <> - <> (<>).','email'); diff --git a/installer/data/mysql/atomicupdate/bug_14224-issue_notes_syspref.sql b/installer/data/mysql/atomicupdate/bug_14224-issue_notes_syspref.sql deleted file mode 100644 index 63d359f1cd..0000000000 --- a/installer/data/mysql/atomicupdate/bug_14224-issue_notes_syspref.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`,`type`) VALUES ('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a7c3747565..253a437f14 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14291,6 +14291,35 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 18110 - Adds FR to the syspref AddressFormat)\n"; } +$DBversion = '16.12.00.029'; +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|); + } + + $dbh->do(q| + INSERT IGNORE INTO letter (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) + VALUES ('circulation', 'PATRON_NOTE', '', 'Patron note on item', '0', 'Patron issue note', '<> <> has added a note to the item <> - <> (<>).','email'); + |); + + $dbh->do(q| + INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`,`type`) + VALUES ('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'); + |); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 14224: Add column issues.note and issues.notedate)\n"; +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5