From 24aef12e33f8a3d56b2a4a5fcdcb8d02ff29f030 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Sat, 25 May 2013 15:03:50 +0200 Subject: [PATCH] smarter tags update trigger --- share/schema.sql | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/share/schema.sql b/share/schema.sql index 2a915e4..1859f55 100644 --- a/share/schema.sql +++ b/share/schema.sql @@ -110,8 +110,23 @@ CREATE TRIGGER IF NOT EXISTS create_tags AFTER INSERT ON source_files BEGIN INSERT INTO tags (source_file,last_change) VALUES (new.id,0); END; -CREATE TRIGGER IF NOT EXISTS force_destination_update_on_tag_update - AFTER UPDATE ON tags +DROP TRIGGER IF EXISTS force_destination_update_on_tag_update; +CREATE TRIGGER force_destination_update_on_tag_update + AFTER UPDATE OF + genre, + albumartist, + year, + album, + disc, + artist, + track, + title, + composer, + performer, + rate, + channels, + bitrate + ON tags BEGIN UPDATE destination_files SET last_change=0 WHERE source_file_id=old.source_file;