Skip to content

Database

kkole3897 edited this page Nov 2, 2020 · 12 revisions

ERD

Entity

  • issue
  • user
  • comment
  • label
  • milestone
  • image
  • repository

Attribute

  • issue
    • id
    • title
    • description
    • create_date
    • update_date
    • close_date
    • author
    • assignees
    • labels
    • milestone
    • comments
    • issue_number
  • user
    • user_id
    • password
    • nickname
    • user_name
    • profile_url
    • oauth
  • comment
    • comment_id
    • description
    • author
    • create_date
    • update_date
    • issue_id
  • label
    • label_id
    • name
    • color
    • description
  • milestone
    • milestone_id
    • title
    • due_date
    • description
    • close_date

IssueTracker-erd

추가 고려 사항

User별로 여러 Repository를 갖고 있고, 해당 Repository별로 다른 Issue들이 있는 것까지 고려할지?

Entity & Attribute

  • repository
    • id
    • owner
    • members
    • name
    • description

IssueTracker-erd-edited

Table Schema

issue tracker table schema

  • user
Column Data type NOT NULL 비고
id STRING O PK, 6~16자
password STRING X 6~12자
user_name STRING X
profile_url STRING X
oauth_type STRING X
  • issue
Column Data type NOT NULL 비고
id INTEGER O PK,AI
title STRING O
description TEXT X
create_at DATETIME O
update_at DATETIME X
close_at DATETIME X
issue_number INTEGER O 1 이상
author STRING X FK
milestone_id INTEGER X FK
repository_id INTEGER O FK
  • comment
Column Data type NOT NULL 비고
id INTEGER O PK,AI
description TEXT O
create_at DATETIME O
update_at DATETIME X
delete_at DATETIME X
author STRING O FK
issue_id INTEGER O FK
  • label
Column Data Type NOT NULL 비고
id INTEGER O PK,AI
name STRING O
description TEXT X
color STRING O
repository_id INTEGER O FK
  • milestone
Column Data type NOT NULL 비고
id INTEGER O PK,AI
title STRING O
description TEXT X
due_date DATETIME X
close_date DATETIME X
repository_id INTEGER O FK
  • repository
Column Data type NOT NULL 비고
id INTEGER O PK,AI
name STRING O
description TEXT X
  • assignee
Column Data type NOT NULL 비고
user_id STRING O PK,FK
issue_id INTEGER O PK,FK
  • member
Column Data type NOT NULL 비고
user_id INTEGER O PK,FK
repository_id INTEGER O PK,FK
role ENUM O admin, maintain, write
  • issue_label
Column Data type NOT NULL 비고
issue_id INTEGER O PK,FK
label_id INTEGER O PK,FK
  • 명명 규칙
    • 모두 소문자로
    • column name js에서는 camelCase, db에는 snake_case로 들어가도록
    • 테이블 이름은 단수형으로

Repository까지 고려해서 Table 변환 (수정: 20.10.28 19:00)

Clone this wiki locally