Skip to main content

TicketTags Table

Description: Associative table to establish a many-to-many relationship between tickets and tags.

Table Definition:

CREATE TABLE TicketTags (
ticketId INT NOT NULL,
tagId INT NOT NULL,
PRIMARY KEY (ticketId, tagId),
FOREIGN KEY (ticketId) REFERENCES Ticket(id),
FOREIGN KEY (tagId) REFERENCES Tags(id)
);

Fields:

Field NameData TypeNullabilityConstraintsDescription
ticketIdINTNOT NULLPRIMARY KEY, FOREIGN KEYReferences Ticket(id).
tagIdINTNOT NULLPRIMARY KEY, FOREIGN KEYReferences Tags(id).