System: |
|
Fields
idTag |
integer |
|
|
|
|
|
|
|
idMedia |
integer |
|
|
|
|
|
|
|
media_type |
text |
|
|
|
|
|
|
|
sorting |
integer |
|
|
|
|
|
|
|
Indexes
Foreign keys
There are no foreign keys for table "taglinks"
Checks
There are no checks for table "taglinks"
Triggers
References
There are no references for table "taglinks"
Definition:
CREATE TABLE taglinks (
idTag integer,
idMedia integer,
media_type text,
sorting integer
);
CREATE UNIQUE INDEX ix_taglinks_1
ON taglinks
(idTag, media_type, idMedia);
CREATE UNIQUE INDEX ix_taglinks_2
ON taglinks
(idMedia, media_type, idTag);
CREATE INDEX ix_taglinks_3
ON taglinks
(media_type);
CREATE TRIGGER delete_tag
AFTER DELETE
ON taglinks
BEGIN DELETE FROM tag WHERE idTag=old.idTag AND idTag NOT IN (SELECT DISTINCT idTag FROM taglinks);
END;