From f8bd40c1a619f530d5d8abc7e82b50b82a7d8db6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 18 Apr 2019 10:08:58 +0000 Subject: [PATCH] Bug 22318: DBRev 18.12.00.058 This includes DBRev 18.12.00.057 for bug 13795 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- Koha/Schema/Result/Statistic.pm | 19 ++--------- .../Bug13795_Remove_unused_columns.perl | 12 ------- .../bug_22318-move-opacnavright-to-news.perl | 18 ----------- installer/data/mysql/updatedatabase.pl | 32 +++++++++++++++++++ 5 files changed, 35 insertions(+), 48 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/Bug13795_Remove_unused_columns.perl delete mode 100644 installer/data/mysql/atomicupdate/bug_22318-move-opacnavright-to-news.perl diff --git a/Koha.pm b/Koha.pm index 10e0379be1..1d88043aaf 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "18.12.00.056"; +$VERSION = "18.12.00.058"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Statistic.pm b/Koha/Schema/Result/Statistic.pm index 62fd4c5f87..4396e4f799 100644 --- a/Koha/Schema/Result/Statistic.pm +++ b/Koha/Schema/Result/Statistic.pm @@ -52,12 +52,6 @@ __PACKAGE__->table("statistics"); data_type: 'longtext' is_nullable: 1 -=head2 usercode - - data_type: 'varchar' - is_nullable: 1 - size: 10 - =head2 itemnumber data_type: 'integer' @@ -80,11 +74,6 @@ __PACKAGE__->table("statistics"); data_type: 'integer' is_nullable: 1 -=head2 associatedborrower - - data_type: 'integer' - is_nullable: 1 - =head2 ccode data_type: 'varchar' @@ -108,8 +97,6 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 16 }, "other", { data_type => "longtext", is_nullable => 1 }, - "usercode", - { data_type => "varchar", is_nullable => 1, size => 10 }, "itemnumber", { data_type => "integer", is_nullable => 1 }, "itemtype", @@ -118,15 +105,13 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 80 }, "borrowernumber", { data_type => "integer", is_nullable => 1 }, - "associatedborrower", - { data_type => "integer", is_nullable => 1 }, "ccode", { data_type => "varchar", is_nullable => 1, size => 80 }, ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-21 19:22:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lnIllYjs9funehkB7Y4jjw +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-18 10:07:43 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dzoFXsATo16GZERh8LYT2A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/installer/data/mysql/atomicupdate/Bug13795_Remove_unused_columns.perl b/installer/data/mysql/atomicupdate/Bug13795_Remove_unused_columns.perl deleted file mode 100644 index 71c7604afc..0000000000 --- a/installer/data/mysql/atomicupdate/Bug13795_Remove_unused_columns.perl +++ /dev/null @@ -1,12 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - if( column_exists('statistics', 'associatedborrower') ) { - $dbh->do(q{ ALTER TABLE statistics DROP COLUMN associatedborrower }); - } - if( column_exists('statistics', 'usercode') ) { - $dbh->do(q{ ALTER TABLE statistics DROP COLUMN usercode }); - } - - SetVersion($DBversion); - print "Upgrade to $DBversion done (Bug 13795 - Delete unused fields from statistics table)\n"; -} diff --git a/installer/data/mysql/atomicupdate/bug_22318-move-opacnavright-to-news.perl b/installer/data/mysql/atomicupdate/bug_22318-move-opacnavright-to-news.perl deleted file mode 100644 index bce5c64ff3..0000000000 --- a/installer/data/mysql/atomicupdate/bug_22318-move-opacnavright-to-news.perl +++ /dev/null @@ -1,18 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - my $opaclang = C4::Context->preference("opaclanguages"); - my @langs; - push @langs, split ( '\,', $opaclang ); - # Get any existing value from the OpacNavRight system preference - my ($OpacNavRight) = $dbh->selectrow_array( q| - SELECT value FROM systempreferences WHERE variable='OpacNavRight'; - |); - if( $OpacNavRight ){ - # If there is a value in the OpacNavRight preference, insert it into opac_news - $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, 'OpacNavRight_$langs[0]', '', '$OpacNavRight')"); - } - # Remove the OpacNavRight system preference - $dbh->do("DELETE FROM systempreferences WHERE variable='OpacNavRight'"); - SetVersion ($DBversion); - print "Upgrade to $DBversion done (Bug 22318: Move contents of OpacNavRight preference to Koha news system)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index fbda23fe20..88e08c4301 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -18193,6 +18193,38 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 8701 - Update OpacHiddenItems system preference description)\n"; } +$DBversion = '18.12.00.057'; +if( CheckVersion( $DBversion ) ) { + if( column_exists('statistics', 'associatedborrower') ) { + $dbh->do(q{ ALTER TABLE statistics DROP COLUMN associatedborrower }); + } + if( column_exists('statistics', 'usercode') ) { + $dbh->do(q{ ALTER TABLE statistics DROP COLUMN usercode }); + } + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 13795 - Delete unused fields from statistics table)\n"; +} + +$DBversion = '18.12.00.058'; +if( CheckVersion( $DBversion ) ) { + my $opaclang = C4::Context->preference("opaclanguages"); + my @langs; + push @langs, split ( '\,', $opaclang ); + # Get any existing value from the OpacNavRight system preference + my ($OpacNavRight) = $dbh->selectrow_array( q| + SELECT value FROM systempreferences WHERE variable='OpacNavRight'; + |); + if( $OpacNavRight ){ + # If there is a value in the OpacNavRight preference, insert it into opac_news + $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, 'OpacNavRight_$langs[0]', '', '$OpacNavRight')"); + } + # Remove the OpacNavRight system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='OpacNavRight'"); + SetVersion ($DBversion); + print "Upgrade to $DBversion done (Bug 22318: Move contents of OpacNavRight preference to Koha news system)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5