From d637acd08c11d694e04954592e7ac8d7c1ed8c13 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 20 Oct 2017 17:02:31 -0300 Subject: [PATCH] Bug 12768: DBRev 17.06.00.018 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- ...acement_cost_processing_fee_management.sql | 2 -- .../bug_12768-update_schema_files.sql | 3 --- installer/data/mysql/updatedatabase.pl | 26 +++++++++++++++++++ 4 files changed, 27 insertions(+), 6 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_12768-replacement_cost_processing_fee_management.sql delete mode 100644 installer/data/mysql/atomicupdate/bug_12768-update_schema_files.sql diff --git a/Koha.pm b/Koha.pm index fc07db9c4e..b07fc2752c 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 = "17.06.00.017"; +$VERSION = "17.06.00.018"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_12768-replacement_cost_processing_fee_management.sql b/installer/data/mysql/atomicupdate/bug_12768-replacement_cost_processing_fee_management.sql deleted file mode 100644 index 3306555d48..0000000000 --- a/installer/data/mysql/atomicupdate/bug_12768-replacement_cost_processing_fee_management.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT IGNORE INTO systempreferences (variable,value,explanation,type) VALUES ('useDefaultReplacementCost',0,'default replacement cost defined in item type','YesNo'); -INSERT IGNORE INTO systempreferences (variable,value,explanation,type) VALUES ('ProcessingFeeNote','','Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied','textarea'); diff --git a/installer/data/mysql/atomicupdate/bug_12768-update_schema_files.sql b/installer/data/mysql/atomicupdate/bug_12768-update_schema_files.sql deleted file mode 100644 index 212c52b7ac..0000000000 --- a/installer/data/mysql/atomicupdate/bug_12768-update_schema_files.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `itemtypes` MODIFY COLUMN `rentalcharge` DECIMAL(28,6) NULL DEFAULT NULL; -ALTER TABLE `itemtypes` ADD `defaultreplacecost` DECIMAL(28,6) NULL DEFAULT NULL AFTER `rentalcharge`; -ALTER TABLE `itemtypes` ADD `processfee` DECIMAL(28,6) NULL DEFAULT NULL AFTER `defaultreplacecost`; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f559378b37..73b4462f9c 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14820,6 +14820,32 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 14826 - Resurrect account offsets table (Add new tables account_offsets and account_offset_types))\n"; } +$DBversion = '17.06.00.018'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,type) VALUES ('useDefaultReplacementCost',0,'default replacement cost defined in item type','YesNo'); + }); + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,type) VALUES ('ProcessingFeeNote','','Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied','textarea'); + }); + $dbh->do(q{ + ALTER TABLE `itemtypes` MODIFY COLUMN `rentalcharge` DECIMAL(28,6) NULL DEFAULT NULL; + }); + unless ( column_exists( 'itemtypes', 'defaultreplacecost' ) ) { + $dbh->do(q{ + ALTER TABLE `itemtypes` ADD `defaultreplacecost` DECIMAL(28,6) NULL DEFAULT NULL AFTER `rentalcharge`; + }); + } + unless ( column_exists( 'itemtypes', 'processfee' ) ) { + $dbh->do(q{ + ALTER TABLE `itemtypes` ADD `processfee` DECIMAL(28,6) NULL DEFAULT NULL AFTER `defaultreplacecost`; + }); + + } + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 12768 - Insert system preferences useDefaultReplacementCost and ProcessingFeeNote + Add new columns defaultreplacecost and processfee to the itemtypes table)\n"; +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.20.1