From 66ec5909ed87ab1fcbf811caa58c1c29015f5708 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 9 May 2017 21:00:43 +0000 Subject: [PATCH] Bug 17762 - DBRev 16.12.00.033 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- Koha/Schema/Result/Borrower.pm | 4 ++-- Koha/Schema/Result/Deletedborrower.pm | 4 ++-- Koha/Schema/Result/Letter.pm | 4 ++-- Koha/Schema/Result/MessageTransport.pm | 4 ++-- .../data/mysql/atomicupdate/bug_xxxxx.perl | 23 ------------------ installer/data/mysql/updatedatabase.pl | 24 +++++++++++++++++++ 7 files changed, 33 insertions(+), 32 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx.perl diff --git a/Koha.pm b/Koha.pm index 738668aebc..be5de96ace 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.032"; +$VERSION = "16.12.00.033"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 6d3e3a5d10..f8da9f633c 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1370,8 +1370,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-03-23 21:42:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dchVNO0KEo638glUkcMLkg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-05-09 21:01:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dc49uW1FevMTWMaWeRVHgA __PACKAGE__->belongs_to( "guarantor", diff --git a/Koha/Schema/Result/Deletedborrower.pm b/Koha/Schema/Result/Deletedborrower.pm index c319a1f675..b7d0b7d6b8 100644 --- a/Koha/Schema/Result/Deletedborrower.pm +++ b/Koha/Schema/Result/Deletedborrower.pm @@ -625,8 +625,8 @@ __PACKAGE__->add_columns( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-03-23 21:29:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sqSjOzPoHG6b9TNRE669DA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-05-09 21:01:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:77wtFNqtEjJry9Qo/d1GrQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Letter.pm b/Koha/Schema/Result/Letter.pm index 2e19aab5ea..36e335245f 100644 --- a/Koha/Schema/Result/Letter.pm +++ b/Koha/Schema/Result/Letter.pm @@ -156,8 +156,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-03-23 21:29:34 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A9wpcu1LVyagxvkrqJMpLw +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-05-09 21:01:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WZxxDvP7M/Ns/e9cFseeNA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/MessageTransport.pm b/Koha/Schema/Result/MessageTransport.pm index 7d3373a03b..82e8ab2805 100644 --- a/Koha/Schema/Result/MessageTransport.pm +++ b/Koha/Schema/Result/MessageTransport.pm @@ -129,8 +129,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-03-23 21:42:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RYvCEp0euH7L07OBlttqPw +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-05-09 21:01:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:v0JbPeSBKkHyINem9W9vxw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx.perl b/installer/data/mysql/atomicupdate/bug_xxxxx.perl deleted file mode 100644 index 65dfbe6b6b..0000000000 --- a/installer/data/mysql/atomicupdate/bug_xxxxx.perl +++ /dev/null @@ -1,23 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - - if( !column_exists( 'letter', 'lang' ) ) { - $dbh->do( "ALTER TABLE letter ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER message_transport_type" ); - } - - if( !column_exists( 'borrowers', 'lang' ) ) { - $dbh->do( "ALTER TABLE borrowers ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER lastseen" ); - $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER lastseen" ); - } - - # Add test on existene of this key - $dbh->do( "ALTER TABLE message_transports DROP FOREIGN KEY message_transports_ibfk_3 "); - $dbh->do( "ALTER TABLE letter DROP PRIMARY KEY "); - $dbh->do( "ALTER TABLE letter ADD PRIMARY KEY (`module`, `code`, `branchcode`, `message_transport_type`, `lang`) "); - - $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) - VALUES ('TranslateNotices', '0', NULL, 'Allow notices to be translated', 'YesNo') "); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug XXXXX - Add columns letter.lang and borrowers.lang to allow translation of notices)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7ed13fad6e..0abd64d5a1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14386,6 +14386,30 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 12063 - Update reserves.expirationdate)\n"; } +$DBversion = '16.12.00.033'; +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'letter', 'lang' ) ) { + $dbh->do( "ALTER TABLE letter ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER message_transport_type" ); + } + + if( !column_exists( 'borrowers', 'lang' ) ) { + $dbh->do( "ALTER TABLE borrowers ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER lastseen" ); + $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER lastseen" ); + } + + # Add test on existene of this key + $dbh->do( "ALTER TABLE message_transports DROP FOREIGN KEY message_transports_ibfk_3 "); + $dbh->do( "ALTER TABLE letter DROP PRIMARY KEY "); + $dbh->do( "ALTER TABLE letter ADD PRIMARY KEY (`module`, `code`, `branchcode`, `message_transport_type`, `lang`) "); + + $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) + VALUES ('TranslateNotices', '0', NULL, 'Allow notices to be translated', 'YesNo') "); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 17762X - Add columns letter.lang and borrowers.lang to allow translation of notices)\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