MyVideos48
Table "taglinks"
Previous topic Chapter index Next topic

System:

Fields
Field Data type PK FK Not Null Default Collate Check On Conflict
idTag integer              
idMedia integer              
media_type text              
sorting integer              

Indexes
Index Fields Primary Unique
ix_taglinks_1 idTag, media_type, idMedia  
ix_taglinks_2 idMedia, media_type, idTag  
ix_taglinks_3 media_type    

Foreign keys
      There are no foreign keys for table "taglinks"

Checks
      There are no checks for table "taglinks"

Triggers
Trigger Enabled Events Type When expression
delete_tag DELETE After  

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;


Previous topic Chapter index Next topic
Generated by ""SQLite Maestro Professional"" at 08.07.2021 23:49:20