# FIXME - The user might be installing a new database, so can't rely
# on /etc/koha.conf anyway.
-my $debug = 1;
+my $debug = 0;
my (
$sth, $sti,
);
my $dbh = C4::Context->dbh;
+print "connected to your DB. Checking & modifying it\n";
#-------------------
# Defines
# Now add any missing tables
foreach $table ( keys %requiretables ) {
- print "Checking $table table...\n" if $debug;
unless ( $existingtables{$table} ) {
- print "Adding $table table...\n";
+ print "Adding $table table...\n";
my $sth = $dbh->prepare("create table $table $requiretables{$table}");
$sth->execute;
if ( $sth->err ) {
# 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";
- }
- }
+ 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'} ) {
#MJR: added syntax entries to close bug 624
}
$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 )");
exit;
# $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
#