From f9702aa7c39e0f2b378f6eb51504c58c758b38b2 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Fri, 6 Feb 2009 14:55:40 +0100 Subject: [PATCH] (bug #2948) change the aqbudgetid column type This patch make a database upgrade, to have an int(11) as a primary unique id, instead of a tinyint(4)(one byte). Signed-off-by: Henri-Damien LAURENT --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase30.pl | 7 +++++++ kohaversion.pl | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index c8d00c4e79..230bff0bde 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -177,7 +177,7 @@ CREATE TABLE `aqbudget` ( `startdate` date NOT NULL default 0, `enddate` date default NULL, `budgetamount` decimal(13,2) default NULL, - `aqbudgetid` tinyint(4) NOT NULL auto_increment, + `aqbudgetid` int(11) NOT NULL auto_increment, `branchcode` varchar(10) default NULL, PRIMARY KEY (`aqbudgetid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/updatedatabase30.pl b/installer/data/mysql/updatedatabase30.pl index dd171583de..e6fda8b480 100644 --- a/installer/data/mysql/updatedatabase30.pl +++ b/installer/data/mysql/updatedatabase30.pl @@ -155,6 +155,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.01.006"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `aqbudget` CHANGE `aqbudgetid` `aqbudgetid` INT( 11 ) NOT NULL AUTO_INCREMENT"); + print "Upgrade to $DBversion done (Change the field)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/kohaversion.pl b/kohaversion.pl index 9250d6462f..761c6870a1 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.00.01.005'; + our $VERSION = '3.00.01.006'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5