From 7f388afb5cf6b014d2d6abd916fb8f4519240810 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 2 Sep 2022 11:13:16 +0000 Subject: [PATCH] Bug 7021: Move to new atomic update structure Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../Bug-7021-Reintroduce_usercode_column.perl | 10 ---------- installer/data/mysql/atomicupdate/bug_7201.pl | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/Bug-7021-Reintroduce_usercode_column.perl create mode 100755 installer/data/mysql/atomicupdate/bug_7201.pl diff --git a/installer/data/mysql/atomicupdate/Bug-7021-Reintroduce_usercode_column.perl b/installer/data/mysql/atomicupdate/Bug-7021-Reintroduce_usercode_column.perl deleted file mode 100644 index dd32d14ebf..0000000000 --- a/installer/data/mysql/atomicupdate/Bug-7021-Reintroduce_usercode_column.perl +++ /dev/null @@ -1,10 +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" ); - - $dbh->do("ALTER TABLE statistics ADD COLUMN categorycode varchar(10) AFTER ccode"); - - # Always end with this (adjust the bug info) - NewVersion( $DBversion, 7021, "Bug 7021 - Introduce categorycode column"); -} diff --git a/installer/data/mysql/atomicupdate/bug_7201.pl b/installer/data/mysql/atomicupdate/bug_7201.pl new file mode 100755 index 0000000000..5df49de4fb --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_7201.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "7021", + description => "Add patron category to the statistics table", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + if( !column_exists( 'statistics', 'categorycode' ) ) { + $dbh->do( + "ALTER TABLE statistics ADD COLUMN categorycode varchar(10) AFTER ccode" + ); + } + }, +}; -- 2.39.5