From 8b849659b8a9c3f2c48f2546deb4c66f093c62b7 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 22 Sep 2021 09:36:24 -0300 Subject: [PATCH] Bug 27945: Move atomicupdate to new format It also removes the implicit dependency on bug 27946 by changing the AFTER column. Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug_27945.perl | 15 --------------- installer/data/mysql/atomicupdate/bug_27945.pl | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_27945.perl create mode 100755 installer/data/mysql/atomicupdate/bug_27945.pl diff --git a/installer/data/mysql/atomicupdate/bug_27945.perl b/installer/data/mysql/atomicupdate/bug_27945.perl deleted file mode 100644 index 4a39162019..0000000000 --- a/installer/data/mysql/atomicupdate/bug_27945.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( "ALTER TABLE biblio ADD COLUMN badtaste int" ); - - # or perform some test and warn - if( !column_exists( 'categories', 'article_request_limit' ) ) { - $dbh->do(q{ - ALTER TABLE `categories` ADD COLUMN `article_request_limit` tinyint(4) DEFAULT NULL COMMENT 'Limit article scan requests per day' AFTER `article_request_fee` - }); - } - - # Always end with this (adjust the bug info) - NewVersion( $DBversion, 27945, "Add article_request_limit to categories table"); -} diff --git a/installer/data/mysql/atomicupdate/bug_27945.pl b/installer/data/mysql/atomicupdate/bug_27945.pl new file mode 100755 index 0000000000..c22e530987 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_27945.pl @@ -0,0 +1,17 @@ +use Modern::Perl; + +return { + bug_number => "27945", + description => "Add article_request_limit to categories table", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Do you stuffs here + if( !column_exists( 'categories', 'article_request_limit' ) ) { + $dbh->do(q{ + ALTER TABLE `categories` + ADD COLUMN `article_request_limit` tinyint(4) DEFAULT NULL COMMENT 'Limit article scan requests per day' AFTER `exclude_from_local_holds_priority` + }); + } + }, +} -- 2.30.2