From e378fb11e649625c0e31b83721084d15483130d3 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Tue, 9 Oct 2007 16:46:47 -0500 Subject: [PATCH] Bumping to 3.00.00.008 : adding biblio.datecreated The top issue was based on a timestamp field, that was updated everytime a biblio is modified This commit add a datecreated field, that is filled only when a biblio is ADDED it is used by opac-topissues & can be useful at other places i'm sure Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Biblio.pm | 2 +- kohaversion.pl | 2 +- updater/updatedatabase | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8ebb1482d2..4f8884c445 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -3268,7 +3268,7 @@ sub _koha_add_biblio { $sth->finish; $sth = $dbh->prepare( "INSERT INTO biblio - SET biblionumber = ?, title = ?, author = ?, copyrightdate = ?, serial = ?, seriestitle = ?, notes = ?, abstract = ?, unititle = ?, frameworkcode = ? " + SET datecreated=NOW(), biblionumber = ?, title = ?, author = ?, copyrightdate = ?, serial = ?, seriestitle = ?, notes = ?, abstract = ?, unititle = ?, frameworkcode = ? " ); $sth->execute( $biblionumber, $biblio->{'title'}, diff --git a/kohaversion.pl b/kohaversion.pl index b9098a82e8..20371aad5e 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -8,7 +8,7 @@ # and is automatically called by Auth.pm when needed. sub kohaversion { - return "3.00.00.007"; + return "3.00.00.008"; } 1; diff --git a/updater/updatedatabase b/updater/updatedatabase index ac451fcc93..c09f516702 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -138,6 +138,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.008"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `biblio` ADD `datecreated` DATE NOT NULL AFTER `timestamp` ;"); + $dbh->do("UPDATE biblio SET datecreated=timestamp"); + print "Upgrade to $DBversion done (biblio creation date)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table -- 2.39.5