From aad8699b015024a2cb1fb63b149ea803a542013b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 9 Apr 2021 14:04:23 +0000 Subject: [PATCH] Bug 14233: DBRev 20.12.00.028 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_14233.perl | 20 ---------------- installer/data/mysql/updatedatabase.pl | 23 +++++++++++++++++++ 3 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_14233.perl diff --git a/Koha.pm b/Koha.pm index be18e52f8c..07620e6786 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 = "20.12.00.027"; +$VERSION = "20.12.00.028"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_14233.perl b/installer/data/mysql/atomicupdate/bug_14233.perl deleted file mode 100644 index 5b4bf48d51..0000000000 --- a/installer/data/mysql/atomicupdate/bug_14233.perl +++ /dev/null @@ -1,20 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if ( CheckVersion($DBversion) ) { - - if ( !column_exists( 'letter', 'id' ) ) { - $dbh->do(q{ALTER TABLE letter DROP PRIMARY KEY}); - $dbh->do( -q{ALTER TABLE letter ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST} - ); - $dbh->do( -q{ALTER TABLE letter ADD UNIQUE KEY letter_uniq_1 (`module`,`code`,`branchcode`,`message_transport_type`,`lang`)} - ); - } - - $dbh->do(q{ - INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) - VALUES ('NoticesLog','',NULL,'If enabled, log changes to notice templates','YesNo') - }); - - NewVersion( $DBversion, 14233, "Add id field to letter table" ); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index eded08fe05..babefb16c9 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -23767,6 +23767,29 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 27069, "Change holdallowed values from numbers to strings"); } +$DBversion = '20.12.00.028'; +if ( CheckVersion($DBversion) ) { + + if ( !column_exists( 'letter', 'id' ) ) { + $dbh->do(q{ + ALTER TABLE letter DROP PRIMARY KEY + }); + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST + }); + $dbh->do(q{ + ALTER TABLE letter ADD UNIQUE KEY letter_uniq_1 (`module`,`code`,`branchcode`,`message_transport_type`,`lang`) + }); + } + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) + VALUES ('NoticesLog','',NULL,'If enabled, log changes to notice templates','YesNo') + }); + + NewVersion( $DBversion, 14233, "Add id field to letter table" ); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5