From b215a7b34d28acd9c19f1de5060ed821443d000d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 16 Mar 2023 15:33:39 -0300 Subject: [PATCH] Bug 8179: Modernize atomic update Signed-off-by: Tomas Cohen Arazi Signed-off-by: Laura Escamilla --- installer/data/mysql/atomicupdate/bug_8179.perl | 15 --------------- installer/data/mysql/atomicupdate/bug_8179.pl | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_8179.perl create mode 100755 installer/data/mysql/atomicupdate/bug_8179.pl diff --git a/installer/data/mysql/atomicupdate/bug_8179.perl b/installer/data/mysql/atomicupdate/bug_8179.perl deleted file mode 100644 index efd5000e10..0000000000 --- a/installer/data/mysql/atomicupdate/bug_8179.perl +++ /dev/null @@ -1,15 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - # you can use $dbh here like: - $dbh->do( qq{ - INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES - ('AcqReceiveMultipleOrderLines', '0', NULL, 'Process multiple order lines at once', 'YesNo') - }); - # or perform some test and warn - # if( !column_exists( 'biblio', 'biblionumber' ) ) { - # warn "There is something wrong"; - # } - - # Always end with this (adjust the bug info) - NewVersion( $DBversion, 8179, "Add AcqReceiveMultipleOrderLines system preference"); -} diff --git a/installer/data/mysql/atomicupdate/bug_8179.pl b/installer/data/mysql/atomicupdate/bug_8179.pl new file mode 100755 index 0000000000..190f03c674 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_8179.pl @@ -0,0 +1,17 @@ +use Modern::Perl; + +return { + bug_number => "8179", + description => "Acquisitions orders: multi-receive", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('AcqReceiveMultipleOrderLines', '0', NULL, 'Process multiple order lines at once', 'YesNo') + }); + + say $out "Added new system preference 'AcqReceiveMultipleOrderLines'"; + }, +}; -- 2.30.2