TagsParentTags Table
Description: Associative table for self-referential many-to-many relationships among tags (for hierarchical tagging).
Table Definition:
CREATE TABLE TagsParentTags (
tagId INT NOT NULL,
parentTagId INT NOT NULL,
PRIMARY KEY (tagId, parentTagId),
FOREIGN KEY (tagId) REFERENCES Tags(id),
FOREIGN KEY (parentTagId) REFERENCES Tags(id)
);
Fields:
| Field Name | Data Type | Nullability | Constraints | Description |
|---|---|---|---|---|
| tagId | INT | NOT NULL | PRIMARY KEY, FOREIGN KEY | Child tag ID (references Tags(id)). |
| parentTagId | INT | NOT NULL | PRIMARY KEY, FOREIGN KEY | Parent tag ID (references Tags(id)). |