From 6935a30cfce7044fd6246dbd9d6ca5d6380772c7 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 1 Feb 2022 21:04:59 -1000 Subject: [PATCH] Bug 29605: DBRev 21.12.00.013 Signed-off-by: Fridolin Somers --- Koha.pm | 2 +- .../bug_29605.pl => db_revs/211200013.pl} | 71 +++++++++---------- 2 files changed, 34 insertions(+), 39 deletions(-) rename installer/data/mysql/{atomicupdate/bug_29605.pl => db_revs/211200013.pl} (58%) diff --git a/Koha.pm b/Koha.pm index f51d56538a..6667af743c 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 = "21.12.00.012"; +$VERSION = "21.12.00.013"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_29605.pl b/installer/data/mysql/db_revs/211200013.pl similarity index 58% rename from installer/data/mysql/atomicupdate/bug_29605.pl rename to installer/data/mysql/db_revs/211200013.pl index 3df37615d8..43097d2e61 100755 --- a/installer/data/mysql/atomicupdate/bug_29605.pl +++ b/installer/data/mysql/db_revs/211200013.pl @@ -12,7 +12,7 @@ return { $dbh->do(q{ ALTER TABLE language_script_mapping - DROP KEY `language_subtag`; + DROP KEY `language_subtag`; }); } @@ -20,7 +20,7 @@ return { $dbh->do(q{ ALTER TABLE language_script_mapping - ADD PRIMARY KEY `language_subtag` (`language_subtag`); + ADD PRIMARY KEY `language_subtag` (`language_subtag`); }); say $out "Added missing primary key on language_script_mapping" @@ -29,61 +29,56 @@ return { unless ( foreign_key_exists('tmp_holdsqueue', 'tmp_holdsqueue_ibfk_3') ) { $dbh->do(q{ ALTER TABLE tmp_holdsqueue - ADD CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE + ADD CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) + REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE }); say $out "Added missing foreign key on tmp_holdsqueue"; } - $dbh->do( - q{ + $dbh->do(q{ ALTER TABLE `account_offsets` MODIFY COLUMN `type` enum( 'CREATE', 'APPLY', 'VOID', 'OVERDUE_INCREASE', 'OVERDUE_DECREASE' ) NOT NULL - } - ); + }); say $out "Ensure NOT NULL on account_offsets.type"; - $dbh->do( - q{ + $dbh->do(q{ ALTER TABLE `additional_contents` MODIFY COLUMN `code` VARCHAR(100) NOT NULL - } - ); + }); say $out "Ensure additional_contents.code is VARCHAR(100)"; - $dbh->do( - q{ + $dbh->do(q{ ALTER TABLE `additional_contents` MODIFY COLUMN `lang` VARCHAR(50) NOT NULL DEFAULT '' - } - ); + }); say $out "Ensure additional_contents.lang is VARCHAR(50)"; - $dbh->do(q{ALTER TABLE search_marc_map MODIFY `marc_type` enum('marc21','unimarc') NOT NULL COMMENT 'what MARC type this map is for'}); + $dbh->do(q{ + ALTER TABLE search_marc_map MODIFY `marc_type` enum('marc21','unimarc') NOT NULL COMMENT 'what MARC type this map is for' + }); say $out "Ensure NOT NULL on search_marc_map.marc_type"; - $dbh->do( - q{ - alter table - `branchtransfers` - modify column - `cancellation_reason` enum( - 'Manual', - 'StockrotationAdvance', - 'StockrotationRepatriation', - 'ReturnToHome', - 'ReturnToHolding', - 'RotatingCollection', - 'Reserve', - 'LostReserve', - 'CancelReserve', - 'ItemLost', - 'WrongTransfer' - ) DEFAULT NULL - after `reason` - } - ); + $dbh->do(q{ + alter table + `branchtransfers` + modify column + `cancellation_reason` enum( + 'Manual', + 'StockrotationAdvance', + 'StockrotationRepatriation', + 'ReturnToHome', + 'ReturnToHolding', + 'RotatingCollection', + 'Reserve', + 'LostReserve', + 'CancelReserve', + 'ItemLost', + 'WrongTransfer' + ) DEFAULT NULL + after `reason` + }); say $out "Ensure branchtransfers.cancellation_reason enum values are uppercase"; }, -} +}; -- 2.39.5