From d9c8942e4ed78f78dc8fd211af7678b410e9a21e Mon Sep 17 00:00:00 2001 From: Indranil Das Gupta Date: Mon, 11 May 2015 06:08:55 +0530 Subject: [PATCH] Bug 14179 - Alters currency field to VARCHAR(255) Alters `currency`.`currency` column from VARCHAR(10) to VARCHAR(255) Test plan ========= 1/ login to Koha staff client and go to Home -> Administration -> Currencies & Exchange rates 2/ add a new currency - Bhutanese Ngultrum, ISO code BTN, currency symbol Nu. and rate of 0.016) and save it. 3/ the currency name should be truncated as 'Bhutanese ' 4/ apply the patch in attachment 39021 [details] [review] 5/ update the db schema by running : % perl installer/data/mysql/updatedatabase.pl 6/ delete currency 'Bhutanese ' 7/ repeat step #2 above 8/ the currency should be saved correctly (without truncation) --- .../data/mysql/atomicupdate/bug_14179-alter-currency-table.sql | 6 ++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_14179-alter-currency-table.sql diff --git a/installer/data/mysql/atomicupdate/bug_14179-alter-currency-table.sql b/installer/data/mysql/atomicupdate/bug_14179-alter-currency-table.sql new file mode 100644 index 0000000..e6a06e6 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_14179-alter-currency-table.sql @@ -0,0 +1,6 @@ +-- +-- Alter `currency` column from VARCHAR(10) to VARCHAR(255) +-- + +ALTER TABLE `currency` + MODIFY COLUMN `currency` VARCHAR(255) NOT NULL DEFAULT ''; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index dd6bac9..08a563d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -742,7 +742,7 @@ CREATE TABLE `class_sources` ( DROP TABLE IF EXISTS `currency`; CREATE TABLE `currency` ( - `currency` varchar(10) NOT NULL default '', + `currency` varchar(255) NOT NULL default '', `symbol` varchar(5) default NULL, `isocode` varchar(5) default NULL, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- 1.9.1