[LON-CAPA-cvs] cvs: loncom /metadata_database searchcat.pl

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 01 Jul 2002 18:23:00 -0000


matthew		Mon Jul  1 14:23:00 2002 EDT

  Modified files:              
    /loncom/metadata_database	searchcat.pl 
  Log:
  Automatically create metadata database if it does not exist.  This happens
  weekly during a cronjob run, not during interactive publishing.
  
  
Index: loncom/metadata_database/searchcat.pl
diff -u loncom/metadata_database/searchcat.pl:1.18 loncom/metadata_database/searchcat.pl:1.19
--- loncom/metadata_database/searchcat.pl:1.18	Fri May 17 10:03:04 2002
+++ loncom/metadata_database/searchcat.pl	Mon Jul  1 14:23:00 2002
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # searchcat.pl "Search Catalog" batch script
 #
-# $Id: searchcat.pl,v 1.18 2002/05/17 14:03:04 matthew Exp $
+# $Id: searchcat.pl,v 1.19 2002/07/01 18:23:00 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -74,6 +74,19 @@
 	print "Cannot connect to database!\n";
 	exit;
     }
+    my $make_metadata_table = "CREATE TABLE IF NOT EXISTS metadata (".
+        "title TEXT, author TEXT, subject TEXT, url TEXT, keywords TEXT, ".
+        "version TEXT, notes TEXT, abstract TEXT, mime TEXT, language TEXT, ".
+        "creationdate DATETIME, lastrevisiondate DATETIME, owner TEXT, ".
+        "copyright TEXT, FULLTEXT idx_title (title), ".
+        "FULLTEXT idx_author (author), FULLTEXT idx_subject (subject), ".
+        "FULLTEXT idx_url (url), FULLTEXT idx_keywords (keywords), ".
+        "FULLTEXT idx_version (version), FULLTEXT idx_notes (notes), ".
+        "FULLTEXT idx_abstract (abstract), FULLTEXT idx_mime (mime), ".
+        "FULLTEXT idx_language (language), FULLTEXT idx_owner (owner), ".
+        "FULLTEXT idx_copyright (copyright)) TYPE=MYISAM";
+    # It would sure be nice to have some logging mechanism.
+    $dbh->do($make_metadata_table);
 }
 
 # ------------------------------------------------------------- get .meta files