tags
Description
Table Definition
CREATE TABLE `tags` (
`tag_id` char(36) NOT NULL DEFAULT (uuid()),
`name` varchar(255) NOT NULL,
`parent_tag_id` char(36) DEFAULT NULL,
PRIMARY KEY (`tag_id`) /*T![clustered_index] CLUSTERED */,
UNIQUE KEY `uq_tags_name` (`name`),
KEY `idx_tags_parent_tag_id` (`parent_tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
Columns
Name |
Type |
Default |
Nullable |
Extra Definition |
Children |
Parents |
Comment |
|---|---|---|---|---|---|---|---|
tag_id |
char(36) |
uuid() |
false |
DEFAULT_GENERATED |
|||
name |
varchar(255) |
false |
|||||
parent_tag_id |
char(36) |
true |
Constraints
Name |
Type |
Definition |
|---|---|---|
PRIMARY |
PRIMARY KEY |
PRIMARY KEY (tag_id) |
uq_tags_name |
UNIQUE |
UNIQUE KEY uq_tags_name (name) |
Indexes
Name |
Definition |
|---|---|
PRIMARY |
PRIMARY KEY (tag_id) USING BTREE |
uq_tags_name |
UNIQUE KEY uq_tags_name (name) USING BTREE |
idx_tags_parent_tag_id |
KEY idx_tags_parent_tag_id (parent_tag_id) USING BTREE |
Relations
erDiagram
"articles_tags" }o--|| "tags" : "Additional Relation"
"tag_article_counts" }o--|| "tags" : "Additional Relation"
"tags" {
char_36_ tag_id PK
}
"articles_tags" {
char_36_ article_id PK
char_36_ tag_id PK
}
"tag_article_counts" {
char_36_ user_id PK
varchar_20_ type PK
char_36_ tag_id PK
}
Generated by tbls