add tags table
This commit is contained in:
parent
d744b3057a
commit
c21f1e22c0
@ -38,6 +38,22 @@ CREATE TABLE mime_actions (
|
|||||||
FOREIGN KEY (destination_id) REFERENCES destinations(id)
|
FOREIGN KEY (destination_id) REFERENCES destinations(id)
|
||||||
ON DELETE CASCADE
|
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
|
CREATE VIEW mime_type_actions AS
|
||||||
SELECT
|
SELECT
|
||||||
@ -70,5 +86,9 @@ BEGIN
|
|||||||
INNER JOIN destinations
|
INNER JOIN destinations
|
||||||
WHERE source_files.id=new.id;
|
WHERE source_files.id=new.id;
|
||||||
END;
|
END;
|
||||||
|
CREATE TRIGGER create_tags AFTER INSERT ON source_files
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO tags (source_file,last_change) VALUES (new.id,0);
|
||||||
|
END;
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user