From 092d52d5cf34eb061e893f89b7ea3f9168ec4330 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 31 Aug 2018 11:58:49 +0000 Subject: [PATCH] Bug 18639: DBRev 18.06.00.023 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- Koha/Schema/Result/Aqorder.pm | 12 ++++++++++-- ...18639_add_replacementprice_field_to_aqorders.perl | 9 --------- installer/data/mysql/updatedatabase.pl | 10 ++++++++++ 4 files changed, 21 insertions(+), 12 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_18639_add_replacementprice_field_to_aqorders.perl diff --git a/Koha.pm b/Koha.pm index 45e49c7e55..9c8a0db287 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.06.00.022"; +$VERSION = "18.06.00.023"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm index 174f3a68c8..f0dca06948 100644 --- a/Koha/Schema/Result/Aqorder.pm +++ b/Koha/Schema/Result/Aqorder.pm @@ -152,6 +152,12 @@ __PACKAGE__->table("aqorders"); is_nullable: 1 size: [13,2] +=head2 replacementprice + + data_type: 'decimal' + is_nullable: 1 + size: [28,6] + =head2 rrp_tax_excluded data_type: 'decimal' @@ -370,6 +376,8 @@ __PACKAGE__->add_columns( }, "rrp", { data_type => "decimal", is_nullable => 1, size => [13, 2] }, + "replacementprice", + { data_type => "decimal", is_nullable => 1, size => [28, 6] }, "rrp_tax_excluded", { data_type => "decimal", is_nullable => 1, size => [28, 6] }, "rrp_tax_included", @@ -653,8 +661,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-07-06 14:12:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/CljC8eGYHoYM3506qYavg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-08-31 11:51:37 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GQEXetlivZm7buQohl8m4A # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/installer/data/mysql/atomicupdate/bug_18639_add_replacementprice_field_to_aqorders.perl b/installer/data/mysql/atomicupdate/bug_18639_add_replacementprice_field_to_aqorders.perl deleted file mode 100644 index 152b14d0e7..0000000000 --- a/installer/data/mysql/atomicupdate/bug_18639_add_replacementprice_field_to_aqorders.perl +++ /dev/null @@ -1,9 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - if( !column_exists( 'aqorders', 'replacementprice' ){ - $dbh->do( "ALTER TABLE aqorders ADD COLUMN replacementprice DECIMAL(28,6)" ); - $dbh->do( "UPDATE aqorders set replacementprice = rrp WHERE replacementprice IS NULL" ); - } - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 18639 - Add replacementprice field to aqorders table)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bfb528c0df..260013fbbe 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -16339,6 +16339,16 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 19383 - Add ability to print hold receipts automatically)\n"; } +$DBversion = '18.06.00.023'; +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'aqorders', 'replacementprice' ) ){ + $dbh->do( "ALTER TABLE aqorders ADD COLUMN replacementprice DECIMAL(28,6)" ); + $dbh->do( "UPDATE aqorders set replacementprice = rrp WHERE replacementprice IS NULL" ); + } + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18639 - Add replacementprice field to aqorders table)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5