Show
Ignore:
Timestamp:
04/13/08 04:41:46 (20 months ago)
Author:
bchoate
Message:

Applied patches from Ogawa-san to add an optimized 'exist' method for testing for existing rows. BugId:69661

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-34/lib/MT/Upgrade.pm

    r1866 r1873  
    368368            updater => { 
    369369                type => 'blog', 
    370                 condition => sub { !(MT::Permission->count({ 
     370                condition => sub { !(MT::Permission->exist({ 
    371371                    blog_id => $_[0]->id, author_id => 0 })) }, 
    372372                code => sub { 
     
    14801480 
    14811481    require MT::Author; 
    1482     return undef if MT::Author->count; 
     1482    return undef if MT::Author->exist; 
    14831483 
    14841484    $self->progress($self->translate_escape("Creating initial blog and user records...")); 
     
    16061606 
    16071607    require MT::Role; 
    1608     return if MT::Role->count(); 
     1608    return if MT::Role->exist(); 
    16091609 
    16101610    foreach my $r (@default_roles) { 
     
    16731673        $terms->{blog_id} = $blog_id; 
    16741674 
    1675         return 1 if MT::Template->count( $terms ); 
     1675        return 1 if MT::Template->exist( $terms ); 
    16761676 
    16771677        $self->progress($self->translate_escape("Creating new template: '[_1]'.", $val->{name})); 
     
    19841984    require MT::Template; 
    19851985    my $dyn_error_template =  
    1986         MT::Template->count({type => 'dynamic_error'}); 
     1986        MT::Template->exist({type => 'dynamic_error'}); 
    19871987    if ($dyn_error_template) { 
    19881988        return 3.1; 
     
    19901990 
    19911991    my $comment_pending_template = 
    1992         MT::Template->count({type => 'comment_pending'}); 
     1992        MT::Template->exist({type => 'comment_pending'}); 
    19931993    if ($comment_pending_template) { 
    19941994        return 3.0;