グループと管理者関係テーブル
Table Definition
CREATE TABLE `group_user_admins` (
`user_id` char(36) NOT NULL,
`group_id` char(36) NOT NULL,
`created_at` datetime(6) DEFAULT NULL,
`updated_at` datetime(6) DEFAULT NULL,
PRIMARY KEY (`user_id`,`group_id`),
KEY `fk_group_user_admins_group` (`group_id`),
CONSTRAINT `fk_group_user_admins_group` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3
Name | Type | Default | Nullable | Children | Parents | Comment |
---|---|---|---|---|---|---|
user_id | char(36) | false | ユーザーUUID | |||
group_id | char(36) | false | groups | グループUUID | ||
created_at | datetime(6) | NULL | true | 関係テーブル作成日時 | ||
updated_at | datetime(6) | NULL | true | 関係テーブル更新日時 |
Name | Type | Definition |
---|---|---|
fk_group_user_admins_group | FOREIGN KEY | FOREIGN KEY (group_id) REFERENCES groups (group_id) |
PRIMARY | PRIMARY KEY | PRIMARY KEY (user_id, group_id) |
Name | Definition |
---|---|
fk_group_user_admins_group | KEY fk_group_user_admins_group (group_id) USING BTREE |
PRIMARY | PRIMARY KEY (user_id, group_id) USING BTREE |
erDiagram
"group_user_admins" }o--|| "groups" : "FOREIGN KEY (group_id) REFERENCES groups (group_id)"
"group_user_admins" {
char_36_ user_id PK
char_36_ group_id PK
datetime_6_ created_at
datetime_6_ updated_at
}
"groups" {
char_36_ group_id PK
varchar_32_ name
text link
text description
datetime_6_ created_at
datetime_6_ updated_at
}
Generated by tbls