bug 4203: add display column to aqbudgets_planning if needed (DBrev 118)
authorGalen Charlton <gmcharlt@gmail.com>
Wed, 17 Feb 2010 10:31:13 +0000 (05:31 -0500)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 17 Feb 2010 10:32:38 +0000 (05:32 -0500)
Had not been included in kohastructure.sql

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index b530724..f2e9423 100644 (file)
@@ -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;
index 32ad48b..e78a587 100755 (executable)
@@ -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
index 9fc1a85..0af7061 100644 (file)
@@ -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