From d3c8136c38bfa14dfc50c20dca6cdd2d17d5ef7e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 25 Sep 2014 11:21:06 +0200 Subject: [PATCH] Bug 12993: Add a default tax rate on item types - DB changes This patch adds a new DB field: itemtypes.gstrate --- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index aeeba17..23b31fc 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1243,6 +1243,7 @@ CREATE TABLE `itemtypes` ( -- defines the item types itemtype varchar(10) NOT NULL default '', -- unique key, a code associated with the item type description mediumtext, -- a plain text explanation of the item type rentalcharge double(16,4) default NULL, -- the amount charged when this item is checked out/issued + gstrate decimal(6,4) default NULL, -- default gst rate to use when ordering this item type notforloan smallint(6) default NULL, -- 1 if the item is not for loan, 0 if the item is available for loan imageurl varchar(200) default NULL, -- URL for the item type icon summary text, -- information from the summary field, may include HTML diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6ea5911..464957d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8781,6 +8781,16 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = '3.17.00.XXX'; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + ALTER TABLE itemtypes ADD COLUMN gstrate decimal(6,4) DEFAULT NULL AFTER rentalcharge + }); + print "Upgrade to $DBversion done (Bug XXXXX: Add DB field itemtypes.gstrate)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 TableExists($table) -- 2.1.0