Skip to content

Latest commit

 

History

History
93 lines (76 loc) · 2.66 KB

contest_teams.md

File metadata and controls

93 lines (76 loc) · 2.66 KB

contest_teams

Description

コンテスト参加チームテーブル

Table Definition
CREATE TABLE `contest_teams` (
  `id` char(36) NOT NULL,
  `contest_id` char(36) NOT NULL,
  `name` varchar(128) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `result` text DEFAULT NULL,
  `link` text DEFAULT NULL,
  `created_at` datetime(6) DEFAULT NULL,
  `updated_at` datetime(6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_contest_teams_contest` (`contest_id`),
  CONSTRAINT `fk_contest_teams_contest` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3

Columns

Name Type Default Nullable Children Parents Comment
id char(36) false contest_team_user_belongings コンテストチームUUID
contest_id char(36) false contests コンテストUUID
name varchar(128) NULL true チーム名
description text NULL true チーム情報
result text NULL true 順位などの結果
link text NULL true コンテストチームの詳細が載っているページへのリンク
created_at datetime(6) NULL true コンテストチーム作成日時
updated_at datetime(6) NULL true コンテストチーム更新日時

Constraints

Name Type Definition
fk_contest_teams_contest FOREIGN KEY FOREIGN KEY (contest_id) REFERENCES contests (id)
PRIMARY PRIMARY KEY PRIMARY KEY (id)

Indexes

Name Definition
fk_contest_teams_contest KEY fk_contest_teams_contest (contest_id) USING BTREE
PRIMARY PRIMARY KEY (id) USING BTREE

Relations

erDiagram

"contest_team_user_belongings" }o--|| "contest_teams" : "FOREIGN KEY (team_id) REFERENCES contest_teams (id)"
"contest_teams" }o--|| "contests" : "FOREIGN KEY (contest_id) REFERENCES contests (id)"

"contest_teams" {
  char_36_ id PK
  char_36_ contest_id FK
  varchar_128_ name
  text description
  text result
  text link
  datetime_6_ created_at
  datetime_6_ updated_at
}
"contest_team_user_belongings" {
  char_36_ team_id PK
  char_36_ user_id PK
  datetime_6_ created_at
  datetime_6_ updated_at
}
"contests" {
  char_36_ id PK
  varchar_128_ name
  text description
  text link
  datetime_6_ since
  datetime_6_ until
  datetime_6_ created_at
  datetime_6_ updated_at
}
Loading

Generated by tbls