From d746d801997a5de4c1555b70d4f59e5a5d5dcca2 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 17 Feb 2010 05:31:13 -0500 Subject: [PATCH] bug 4203: add display column to aqbudgets_planning if needed (DBrev 118) Had not been included in kohastructure.sql Signed-off-by: Galen Charlton --- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ kohaversion.pl | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index b530724e94..f2e9423683 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2441,6 +2441,7 @@ CREATE TABLE `aqbudgets_planning` ( `estimated_amount` decimal(28,6) default NULL, `authcat` varchar(30) NOT NULL, `authvalue` varchar(30) NOT NULL, + `display` tinyint(1) DEFAULT 1, PRIMARY KEY (`plan_id`), CONSTRAINT `aqbudgets_planning_ifbk_1` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 32ad48bf91..e78a587a33 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3445,6 +3445,18 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.01.00.118'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my ($count) = $dbh->selectrow_array("SELECT count(*) FROM information_schema.columns + WHERE table_name = 'aqbudgets_planning' + AND column_name = 'display'"); + if ($count < 1) { + $dbh->do("ALTER TABLE aqbudgets_planning ADD COLUMN display tinyint(1) DEFAULT 1"); + } + print "Upgrade to $DBversion done (bug 4203: add display column to aqbudgets_planning if missing)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/kohaversion.pl b/kohaversion.pl index 9fc1a85457..0af70612ba 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.01.00.117'; + our $VERSION = '3.01.00.118'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5