From 04319ef5a0b2462f71bf5f9e6762319b4bbf542c Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 16 Sep 2022 10:54:54 -0300 Subject: [PATCH] Bug 15348: (QA follow-up) DB update fixes Signed-off-by: Tomas Cohen Arazi --- ...8-add_aqorders.estimated_delivery_date.perl | 9 --------- installer/data/mysql/atomicupdate/bug_15348.pl | 18 ++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_15348-add_aqorders.estimated_delivery_date.perl create mode 100644 installer/data/mysql/atomicupdate/bug_15348.pl diff --git a/installer/data/mysql/atomicupdate/bug_15348-add_aqorders.estimated_delivery_date.perl b/installer/data/mysql/atomicupdate/bug_15348-add_aqorders.estimated_delivery_date.perl deleted file mode 100644 index f7c9840ef2..0000000000 --- a/installer/data/mysql/atomicupdate/bug_15348-add_aqorders.estimated_delivery_date.perl +++ /dev/null @@ -1,9 +0,0 @@ -use Date::Calc qw( Add_Delta_Days ); -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - unless( column_exists( 'aqorders', 'estimated_delivery_date' ) ) { - $dbh->do(q{ ALTER TABLE aqorders ADD estimated_delivery_date date default null AFTER suppliers_report }); - - NewVersion( $DBversion, 15348, "Add new column aqorders.estimated_delivery_date" ); - } -} diff --git a/installer/data/mysql/atomicupdate/bug_15348.pl b/installer/data/mysql/atomicupdate/bug_15348.pl new file mode 100644 index 0000000000..419ed2dcd0 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_15348.pl @@ -0,0 +1,18 @@ +use Modern::Perl; + +return { + bug_number => "15348", + description => "Add new column aqorders.estimated_delivery_date", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + unless ( column_exists( 'aqorders', 'estimated_delivery_date' ) ) { + $dbh->do(q{ + ALTER TABLE aqorders + ADD estimated_delivery_date date DEFAULT NULL COMMENT 'Estimated delivery date' + AFTER suppliers_report + }); + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 32b30f1786..ff7cdc626a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -693,7 +693,7 @@ CREATE TABLE `aqorders` ( `suppliers_reference_number` varchar(35) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Suppliers unique edifact quote ref', `suppliers_reference_qualifier` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Type of number above usually ''QLI''', `suppliers_report` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'reports received from suppliers', - `estimated_delivery_date` date default null, + `estimated_delivery_date` date DEFAULT NULL COMMENT 'Estimated delivery date', PRIMARY KEY (`ordernumber`), KEY `basketno` (`basketno`), KEY `biblionumber` (`biblionumber`), -- 2.39.5