#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
#------------------------------------------------------------
package RPS::DB::Item::AlbumAdditionalArtist;
use strict;
use warnings;

use lib '/app/tools/rps/lib';

use lib '/app/tools/common/lib';
use Common::DB::Item;
use Common::Assert;

use base 'Common::DB::Item';

use constant kTable => 'album_additional_artist';
use constant kDB => Common::DB::Item::kClientDB();

sub Delete {
    my $class = shift;
    my %args = @_;

    my $dbo = Common::RSApp::GetClientDB();
    my $sql = "DELETE FROM " . kTable . " WHERE " .
              "album_id = " . $dbo->DBQuote($args{album_id}) . " AND " .
              "artist_id = " . $dbo->DBQuote($args{artist_id}) . " AND " .
              "artist_role_id = " . $dbo->DBQuote($args{artist_role_id});

    Common::Log::Debug( "QUERY: $sql" );
    $dbo->DoCmd($sql);
}

sub GetAllForAlbumID
{
    my ($class, $albumID) = @_;
    assert($albumID);

    return $class->GetAll("SELECT * FROM " . kTable . " WHERE album_id=$albumID");
}


1;
