[Koha-patches] [PATCH 2/2] bug 4203: add display column to aqbudgets_planning if needed (DBrev 118)
Galen Charlton
gmcharlt at gmail.com
Wed Feb 17 11:32:09 CET 2010
Had not been included in kohastructure.sql
Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
installer/data/mysql/kohastructure.sql | 1 +
installer/data/mysql/updatedatabase.pl | 12 ++++++++++++
kohaversion.pl | 2 +-
3 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index b530724..f2e9423 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 32ad48b..e78a587 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 9fc1a85..0af7061 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
--
1.6.3.3
More information about the Koha-patches
mailing list