Changeset 441


Ignore:
Timestamp:
06/25/12 19:36:48 (12 years ago)
Author:
nanardon
Message:
  • fix DBIx query, find() w/o key is now fatal
Location:
server/trunk/web/lib/Sophie
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/web/lib/Sophie/Base/Result/DesktopFiles.pm

    r355 r441  
    88__PACKAGE__->add_columns(qw/pkgid count desktop_file_pkey/); 
    99__PACKAGE__->set_primary_key(qw/desktop_file_pkey/); 
     10__PACKAGE__->add_unique_constraint('pkgid_count' => [ 'pkgid', 'count' ]); 
    1011__PACKAGE__->belongs_to(BinFiles => 'Sophie::Base::Result::BinFiles', [ 'pkgid', 'count' ]); 
    1112__PACKAGE__->belongs_to(Rpms => 'Sophie::Base::Result::Rpms', 'pkgid'); 
  • server/trunk/web/lib/Sophie/Scan/RpmParser/Desktopfile.pm

    r363 r441  
    7373                                count => $filelist{$fname}->count, 
    7474                                pkgid => $pkgid, 
    75                             } 
     75                            }, 
     76                            { key => 'pkgid_count' }, 
    7677                        ); 
    7778                        foreach my $param ($ini->Parameters('Desktop Entry')) { 
  • server/trunk/web/lib/Sophie/Scan/RpmsPath.pm

    r434 r441  
    2727     
    2828    $self->db->base->resultset('Paths')->find( 
    29         { d_path_key => $self->key } 
     29        { d_path_key => $self->key }, 
     30        { key => 'd_path_key' }, 
    3031    )->path; 
    3132} 
     
    122123    my ($self, $exists) = @_; 
    123124    $self->db->base->resultset('Paths')->find( 
    124         { d_path_key => $self->key } 
     125        { d_path_key => $self->key }, 
     126        { key => 'd_path_key' }, 
    125127    )->update({ 'exists' => ($exists ? 1 : 0) }); 
    126128    $self->db->commit; 
     
    130132    my ($self) = @_; 
    131133    $self->db->base->resultset('Paths')->find( 
    132         { d_path_key => $self->key } 
     134        { d_path_key => $self->key }, 
     135        { key => 'd_path_key' }, 
    133136    )->update({ needupdate => 0 }); 
    134137    $self->db->commit; 
     
    138141    my ($self) = @_; 
    139142    $self->db->base->resultset('Paths')->find( 
    140         { d_path_key => $self->key } 
     143        { d_path_key => $self->key }, 
     144        { key => 'd_path_key' }, 
    141145    )->get_column('needupdate'); 
    142146} 
     
    145149    my ($self) = @_; 
    146150    $self->db->base->resultset('Paths')->find( 
    147         { d_path_key => $self->key } 
     151        { d_path_key => $self->key }, 
     152        { key => 'd_path_key' }, 
    148153    )->update({ 'updated' => \'now()' }); 
    149154    $self->db->commit; 
Note: See TracChangeset for help on using the changeset viewer.