@@ -, +, @@ --- .../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 --- a/installer/data/mysql/atomicupdate/Bug-7021-Reintroduce_usercode_column.perl +++ a/installer/data/mysql/atomicupdate/Bug-7021-Reintroduce_usercode_column.perl @@ -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"); -} --- a/installer/data/mysql/atomicupdate/bug_7201.pl +++ a/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" + ); + } + }, +}; --