From 263e5b110d4e493acff2bc63286089281f4f49a0 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 9 Mar 2020 13:11:55 -0400 Subject: [PATCH] Bug 21443: Update database Signed-off-by: Kyle M Hall Signed-off-by: Marti Fuerst --- .../data/mysql/atomicupdate/bug_21443.perl | 22 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_21443.perl diff --git a/installer/data/mysql/atomicupdate/bug_21443.perl b/installer/data/mysql/atomicupdate/bug_21443.perl new file mode 100644 index 0000000000..74cf57f650 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_21443.perl @@ -0,0 +1,22 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'itemtypes', 'rentalcharge_daily_calendar' ) ) { + $dbh->do(q{ + ALTER TABLE itemtypes ADD COLUMN + rentalcharge_daily_calendar tinyint(1) NOT NULL DEFAULT 1 + AFTER rentalcharge_daily; + }); + } + + if( !column_exists( 'itemtypes', 'rentalcharge_hourly_calendar' ) ) { + $dbh->do(q{ + ALTER TABLE itemtypes ADD COLUMN + rentalcharge_hourly_calendar tinyint(1) NOT NULL DEFAULT 1 + AFTER rentalcharge_hourly; + }); + } + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 21443: Add ability to exclude holidays when calculating rentals fees by time period)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0f092725b5..b97af9517f 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -878,7 +878,9 @@ CREATE TABLE `itemtypes` ( -- defines the item types description LONGTEXT, -- a plain text explanation of the item type rentalcharge decimal(28,6) default NULL, -- the amount charged when this item is checked out/issued rentalcharge_daily decimal(28,6) default NULL, -- the amount charged for each day between checkout date and due date + rentalcharge_daily_calendar tinyint(1) NOT NULL DEFAULT 1, -- controls if the daily retnal fee is calculated directly or using finesCalendar rentalcharge_hourly decimal(28,6) default NULL, -- the amount charged for each hour between checkout date and due date + rentalcharge_hourly_calendar tinyint(1) NOT NULL DEFAULT 1, -- controls if the hourly retnal fee is calculated directly or using finesCalendar defaultreplacecost decimal(28,6) default NULL, -- default replacement cost processfee decimal(28,6) default NULL, -- default text be recorded in the column note when the processing fee is applied notforloan smallint(6) default NULL, -- 1 if the item is not for loan, 0 if the item is available for loan -- 2.21.1 (Apple Git-122.3)