--- db/prgsrc/mkdb.pl 2002/01/07 01:31:00 1.13 +++ db/prgsrc/mkdb.pl 2005/07/05 21:27:12 1.18 @@ -23,7 +23,7 @@ The database, user and password are hard Dmitry Rubinstein -=head1 $Id: mkdb.pl,v 1.13 2002/01/07 01:31:00 boris Exp $ +=head1 $Id: mkdb.pl,v 1.18 2005/07/05 21:27:12 boris Exp $ =cut @@ -37,7 +37,7 @@ sub CheckTable my ($TabName) = @_; my ($ans); - if (scalar(grep(/^$TabName$/, @tbl_list))) { + if (scalar(grep(/^$TabName$/i, @tbl_list))) { print "Table $TabName exists. Do you want to delete it? "; $ans = ; if ($ans =~ /[yY]/) { @@ -57,7 +57,7 @@ print "Before connecting to the DB\n"; or die "Can't connect to DB chgk\n" . $dbh->errstr; print "Connected successfully\n"; - @tbl_list = $dbh->func( '_ListTables' ); + @tbl_list = $dbh->tables(); &CheckTable("Questions"); $dbh->do("CREATE TABLE Questions ( @@ -67,17 +67,18 @@ print "Connected successfully\n"; KEY ParentIdKey (ParentId), Number SMALLINT UNSIGNED NOT NULL, KEY NumberKey (Number), - Type CHAR(5), + Type CHAR(5) NOT NULL DEFAULT 'þ', KEY TypeKey (Type), Question TEXT, Answer TEXT, + PassCriteria TEXT, Authors TEXT, Sources TEXT, Comments TEXT, Rating TEXT, Topic TEXT, ProcessedBySearch INT - )") + ) TYPE=MyISAM") or die "Can't create Questions table: $!\n"; &CheckTable("Tournaments"); @@ -99,7 +100,7 @@ print "Connected successfully\n"; EnteredBy TEXT, PlayedAt DATE, CreatedAt DATE NOT NULL - )") + ) TYPE=MyISAM") or die "Can't create Tournaments table: $!\n"; # CREATE INDEX ParentInd ON Tournaments (ParentId)