Skip to content

Latest commit

 

History

History
110 lines (93 loc) · 2.92 KB

users.md

File metadata and controls

110 lines (93 loc) · 2.92 KB

users

Description

ユーザーテーブル

Table Definition
CREATE TABLE `users` (
  `id` char(36) NOT NULL,
  `description` text NOT NULL,
  `check` tinyint(1) NOT NULL DEFAULT 0,
  `name` varchar(32) NOT NULL,
  `state` tinyint(1) NOT NULL,
  `created_at` datetime(6) DEFAULT NULL,
  `updated_at` datetime(6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_users_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3

Columns

Name Type Default Nullable Children Parents Comment
id char(36) false accounts contest_team_user_belongings group_user_belongings project_members ユーザーUUID
description text false 自己紹介文
check tinyint(1) 0 false 氏名を公開するかどうかの可否 (0: 停止, 1: 有効, 2: 一時停止)
name varchar(32) false ユーザー名
state tinyint(1) false traQのユーザーアカウント状態
created_at datetime(6) NULL true
updated_at datetime(6) NULL true

Constraints

Name Type Definition
PRIMARY PRIMARY KEY PRIMARY KEY (id)
uni_users_name UNIQUE UNIQUE KEY uni_users_name (name)

Indexes

Name Definition
PRIMARY PRIMARY KEY (id) USING BTREE
uni_users_name UNIQUE KEY uni_users_name (name) USING BTREE

Relations

erDiagram

"accounts" }o--|| "users" : "FOREIGN KEY (user_id) REFERENCES users (id)"
"contest_team_user_belongings" }o--|| "users" : "FOREIGN KEY (user_id) REFERENCES users (id)"
"group_user_belongings" }o--|| "users" : "FOREIGN KEY (user_id) REFERENCES users (id)"
"project_members" }o--|| "users" : "FOREIGN KEY (user_id) REFERENCES users (id)"

"users" {
  char_36_ id PK
  text description
  tinyint_1_ check
  varchar_32_ name
  tinyint_1_ state
  datetime_6_ created_at
  datetime_6_ updated_at
}
"accounts" {
  char_36_ id PK
  tinyint_1_ type
  varchar_256_ name
  text url
  char_36_ user_id FK
  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
}
"group_user_belongings" {
  char_36_ user_id PK
  char_36_ group_id PK
  smallint_4_ since_year
  tinyint_1_ since_semester
  smallint_4_ until_year
  tinyint_1_ until_semester
  datetime_6_ created_at
  datetime_6_ updated_at
}
"project_members" {
  char_36_ project_id PK
  char_36_ user_id PK
  smallint_4_ since_year
  tinyint_1_ since_semester
  smallint_4_ until_year
  tinyint_1_ until_semester
  datetime_6_ created_at
  datetime_6_ updated_at
}
Loading

Generated by tbls