Commit 8e1a90b2 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Artist: Don't insert unknown/various artists in FTS

parent a285ee80
......@@ -245,11 +245,13 @@ bool Artist::createTriggers(DBConnection dbConnection)
static const std::string ftsInsertTrigger = "CREATE TRIGGER IF NOT EXISTS insert_artist_fts"
" AFTER INSERT ON " + policy::ArtistTable::Name +
" WHEN new.name IS NOT NULL"
" BEGIN"
" INSERT INTO " + policy::ArtistTable::Name + "Fts(rowid,name) VALUES(new.id_artist, new.name);"
" END";
static const std::string ftsDeleteTrigger = "CREATE TRIGGER IF NOT EXISTS delete_artist_fts"
" BEFORE DELETE ON " + policy::ArtistTable::Name +
" WHEN old.name IS NOT NULL"
" BEGIN"
" DELETE FROM " + policy::ArtistTable::Name + "Fts WHERE rowid=old.id_artist;"
" END";
......
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