From 5d4b0048acf78a04d16fc7aa6605a7234e86a163 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Tue, 18 Mar 2008 00:39:45 -0400 Subject: [PATCH] partial fix for bug 1873: virtualshelfcontents dateadded column empty Signed-off-by: Joshua Ferraro --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 9 +++++++++ kohaversion.pl | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index b7d01de227..98c6ae1ff1 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1909,7 +1909,7 @@ CREATE TABLE `virtualshelfcontents` ( `shelfnumber` int(11) NOT NULL default 0, `biblionumber` int(11) NOT NULL default 0, `flags` int(11) default NULL, - `dateadded` timestamp NULL default NULL, + `dateadded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY `shelfnumber` (`shelfnumber`), KEY `biblionumber` (`biblionumber`), CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7343e71357..6ab5eb96e1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1214,6 +1214,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.066"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `virtualshelfcontents` MODIFY `dateadded` timestamp NOT NULL +DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP; +"); + print "Upgrade to $DBversion done (fix for bug 1873: virtualshelfcontents dateadded column empty. ) "; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/kohaversion.pl b/kohaversion.pl index 73d62f9c66..749cdfe7c4 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = "3.00.00.065"; + our $VERSION = "3.00.00.066"; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5