[Koha-cvs] CVS: koha/updater updatedatabase,1.66,1.67

Paul POULAIN tipaul at users.sourceforge.net
Fri Nov 28 11:08:36 CET 2003


Update of /cvsroot/koha/koha/updater
In directory sc8-pr-cvs1:/tmp/cvs-serv9491/updater

Modified Files:
	updatedatabase 
Log Message:
* removing too verbose messages.
* creating a fulltext index on bibliothesaurus

Index: updatedatabase
===================================================================
RCS file: /cvsroot/koha/koha/updater/updatedatabase,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -r1.66 -r1.67
*** updatedatabase	12 Nov 2003 16:14:42 -0000	1.66
--- updatedatabase	28 Nov 2003 10:08:33 -0000	1.67
***************
*** 25,29 ****
  # on /etc/koha.conf anyway.
  
! my $debug = 1;
  
  my (
--- 25,29 ----
  # on /etc/koha.conf anyway.
  
! my $debug = 0;
  
  my (
***************
*** 39,42 ****
--- 39,43 ----
  
  my $dbh = C4::Context->dbh;
+ print "connected to your DB. Checking & modifying it\n";
  
  #-------------------
***************
*** 624,630 ****
  # Now add any missing tables
  foreach $table ( keys %requiretables ) {
-     print "Checking $table table...\n" if $debug;
      unless ( $existingtables{$table} ) {
!         print "Adding $table table...\n";
          my $sth = $dbh->prepare("create table $table $requiretables{$table}");
          $sth->execute;
--- 625,630 ----
  # Now add any missing tables
  foreach $table ( keys %requiretables ) {
      unless ( $existingtables{$table} ) {
! 	print "Adding $table table...\n";
          my $sth = $dbh->prepare("create table $table $requiretables{$table}");
          $sth->execute;
***************
*** 638,648 ****
  # now drop useless tables
  foreach $table ( keys %dropable_table ) {
!     print "Dropping unused tables...\n" if $debug;
!     if ( $existingtables{$table} ) {
!         $dbh->do("drop table $table");
!         if ( $dbh->err ) {
!             print "Error : $dbh->errstr \n";
!         }
!     }
  }
  unless ( $existingtables{'z3950servers'} ) {
--- 638,648 ----
  # now drop useless tables
  foreach $table ( keys %dropable_table ) {
! 	if ( $existingtables{$table} ) {
! 		print "Dropping unused table $table\n" if $debug;
! 		$dbh->do("drop table $table");
! 		if ( $dbh->err ) {
! 			print "Error : $dbh->errstr \n";
! 		}
! 	}
  }
  unless ( $existingtables{'z3950servers'} ) {
***************
*** 831,834 ****
--- 831,849 ----
  $dbh->do("ALTER TABLE `items` CHANGE `barcode` `barcode` VARCHAR( 20 )") unless ($nullenabled{barcode} eq 'YES');
  
+ #
+ # creating fulltext index in bibliothesaurus if needed
+ #
+ $sth = $dbh->prepare("show index from bibliothesaurus");
+ $sth->execute;
+ my $exists=0;
+ while ( my ( $table, $non_unique, $key_name, $Seq_in_index, $Column_name, $Collation, $cardinality, $sub_part, $Packed, $comment ) = $sth->fetchrow )
+ {
+ 	if ($key_name eq 'category_2') {
+ 		$exists=1;
+ 	}
+ }
+ print "Creating fulltext index on bibliothesaurus\n" unless $exists;
+ $dbh->do('create fulltext index category_2 on bibliothesaurus (category,freelib)') unless $exists;
+ 
  # changing z3950daemon field to NULL in marc_breeding
  $dbh->do("ALTER TABLE `marc_breeding` CHANGE `z3950random` `z3950random` VARCHAR( 40 )");
***************
*** 956,959 ****
--- 971,978 ----
  
  # $Log$
+ # Revision 1.67  2003/11/28 10:08:33  tipaul
+ # * removing too verbose messages.
+ # * creating a fulltext index on bibliothesaurus
+ #
  # Revision 1.66  2003/11/12 16:14:42  slef
  # lengthen cardnumber to 16 and make it unique





More information about the Koha-cvs mailing list