diff --git a/share/schema.sql b/share/schema.sql index ac40b2a..6c09167 100644 --- a/share/schema.sql +++ b/share/schema.sql @@ -38,6 +38,22 @@ CREATE TABLE mime_actions ( FOREIGN KEY (destination_id) REFERENCES destinations(id) ON DELETE CASCADE ); +CREATE TABLE tags ( + source_file INTEGER PRIMARY KEY, + genre TEXT, + albumartist TEXT, + year TEXT, + album TEXT, + disc TEXT, + artist TEXT, + track TEXT, + title TEXT, + composer TEXT, + performer TEXT, + last_change INTEGER, + FOREIGN KEY (source_file) REFERENCES source_files(id) + ON DELETE CASCADE +); CREATE VIEW mime_type_actions AS SELECT @@ -70,5 +86,9 @@ BEGIN INNER JOIN destinations WHERE source_files.id=new.id; END; +CREATE TRIGGER create_tags AFTER INSERT ON source_files +BEGIN + INSERT INTO tags (source_file,last_change) VALUES (new.id,0); +END; COMMIT;