Show
Ignore:
Timestamp:
06/02/06 19:40:31 (6 years ago)
Author:
dom
Message:

Check that we can do all we need to when upgrading MySQL database (closes #8)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Setup/Database.pm

    r290 r319  
    254254    print "done\n"; 
    255255} 
     256 
     257sub perm_check { 
     258    my $dbh = shift; 
     259    # If we can do all this, we'll be able to do a bulk upgrade too 
     260    eval { 
     261        my $sth = $dbh->prepare("CREATE TABLE dbtest (test int)"); 
     262        $sth->execute; 
     263 
     264        $sth = $dbh->prepare("CREATE INDEX dbtest_index ON dbtest (test)"); 
     265        $sth->execute; 
     266 
     267        $sth = $dbh->prepare("DROP TABLE dbtest"); 
     268        $sth->execute; 
     269    }; 
     270    return $@; 
     271}