Bumping to 3.00.00.008 : adding biblio.datecreated
authorPaul POULAIN <paul@koha-fr.org>
Tue, 9 Oct 2007 21:46:47 +0000 (16:46 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 10 Oct 2007 00:09:42 +0000 (19:09 -0500)
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 <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Biblio.pm
kohaversion.pl
updater/updatedatabase

index 8ebb148..4f8884c 100644 (file)
@@ -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'},
index b9098a8..20371aa 100644 (file)
@@ -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;
index ac451fc..c09f516 100755 (executable)
@@ -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