[Koha-patches] [PATCH] (bug #4287) add enrolment period update in 22 to 30 script

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Mon Mar 1 16:21:36 CET 2010


this fix the upgrade script, to upgrade the enrolment period, that is no more in years, but in month unity.
---
 installer/data/mysql/update22to30.pl |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/installer/data/mysql/update22to30.pl b/installer/data/mysql/update22to30.pl
index 435d767..d470743 100755
--- a/installer/data/mysql/update22to30.pl
+++ b/installer/data/mysql/update22to30.pl
@@ -3500,7 +3500,7 @@ my $DBversion = "3.00.00.000";
     
     # at last, remove useless fields
     foreach $table ( keys %uselessfields ) {
-        my @fields = split /,/,$uselessfields{$table};
+        my @fields = split (/,/,$uselessfields{$table});
         my $fields;
         my $exists;
         foreach my $fieldtodrop (@fields) {
@@ -3526,11 +3526,14 @@ my $DBversion = "3.00.00.000";
     #
     $sth=$dbh->prepare("ALTER TABLE `aqbookfund` DROP PRIMARY KEY , ADD PRIMARY KEY ( `bookfundid` , `branchcode` ) ;");
     $sth->execute;
+    $sth->finish;
    
     # drop extra key on borrowers.borrowernumber
     $dbh->do("ALTER TABLE borrowers DROP KEY borrowernumber"); 
-
-    $sth->finish;
+    
+    # update enrolmentperiod
+    $dbh->do("UPDATE categories SET enrolmentperiod = enrolmentperiod * 12");
+    
     print "upgrade to Koha 3.0 done\n";
     SetVersion ($DBversion);
 
-- 
1.6.3.3




More information about the Koha-patches mailing list