Commit 1a0d7284 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Artist: Ensure is_present is always 1 or 0

parent d71d36bd
......@@ -226,7 +226,8 @@ bool Artist::createTriggers( sqlite::Connection* dbConnection )
"is_present ON " + policy::AlbumTable::Name +
" BEGIN "
" UPDATE " + policy::ArtistTable::Name + " SET is_present="
"(SELECT COUNT(id_album) FROM " + policy::AlbumTable::Name + " WHERE artist_id=new.artist_id AND is_present=1) "
"(SELECT COUNT(id_album) FROM " + policy::AlbumTable::Name +
" WHERE artist_id=new.artist_id AND is_present=1 LIMIT 1) "
"WHERE id_artist=new.artist_id;"
" END";
// Automatically delete the artists that don't have any albums left, except the 2 special artists.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment