[Koha-cvs] koha/updater updatedatabase [rel_2_2]

paul poulain paul at koha-fr.org
Thu Aug 31 16:37:04 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	paul poulain <tipaul>	06/08/31 14:37:04

Modified files:
	updater        : updatedatabase 

Log message:
	fix for :
	http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1140
	(published date never null now)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&only_with_tag=rel_2_2&r1=1.100.2.53&r2=1.100.2.54

Patches:
Index: updatedatabase
===================================================================
RCS file: /cvsroot/koha/koha/updater/updatedatabase,v
retrieving revision 1.100.2.53
retrieving revision 1.100.2.54
diff -u -b -r1.100.2.53 -r1.100.2.54
--- updatedatabase	9 Aug 2006 16:28:30 -0000	1.100.2.53
+++ updatedatabase	31 Aug 2006 14:37:04 -0000	1.100.2.54
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: updatedatabase,v 1.100.2.53 2006/08/09 16:28:30 kados Exp $
+# $Id: updatedatabase,v 1.100.2.54 2006/08/31 14:37:04 tipaul Exp $
 
 # Database Updater
 # This script checks for required updates to the database.
@@ -2104,6 +2104,18 @@
         }
     }
 }
+
+
+#
+# update publisheddate 
+#
+$sth = $dbh->prepare("select count(*) from serial where publisheddate is NULL");
+$sth->execute;
+my ($emptypublished) = $sth->fetchrow;
+if ($emptypublished) {
+    print "Updating publisheddate\n";
+    $dbh->do("update serial set publisheddate=planneddate where publisheddate is NULL");
+}
 foreach my $table ( keys %tabledata ) {
     print "Checking for data required in table $table...\n" unless $silent;
     my $tablerows = $tabledata{$table};
@@ -2181,6 +2193,11 @@
 exit;
 
 # $Log: updatedatabase,v $
+# Revision 1.100.2.54  2006/08/31 14:37:04  tipaul
+# fix for :
+# http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1140
+# (published date never null now)
+#
 # Revision 1.100.2.53  2006/08/09 16:28:30  kados
 # adds ReceiveBackIssues systempref with default set to 5
 #





More information about the Koha-cvs mailing list