Skip to content

[BE] ERD

MODI edited this page Aug 17, 2023 · 9 revisions
image

issue 75 issue 328

// Use DBML to define your database structure
// Docs: https://dbml.dbdiagram.io/docs

Table pomodoro_room {
  id bigint [primary key]
  participant_code_id bigint
  name varchar(255)
  total_cycle int
  time_per_cycle int
  created_date datetime(6)
  last_modified_date datetime(6)
}

Table participant_code {
  id bigint [primary key]
  code varchar(255)
  created_date datetime(6)
  last_modified_date datetime(6)
}

Table pomodoro_content {
  id bigint [primary key]
  pomodoro_progress_id bigint
  cycle int
  plan text
  retrospect text
  created_date datetime(6)
  last_modified_date datetime(6)
}

Table member {
  id bigint [primary key]
  name varchar(255)
  email varchar(255)
  image_url varchar(255)
  login_type enum('GUEST','GOOGLE')
  created_date datetime(6)
  last_modified_date datetime(6)
}

Table refresh_token {
  id bigint [primary key]
  member_id int
  uuid binary(16)
  expire_date datetime(6)
  created_date datetime(6)
  last_modified_date datetime(6)
}

Table pomodoro_progress {
  id bigint [primary key]
  pomodoro_room_id bigint
  member_id bigint
  nickname varchar(255)
  current_cycle int
  pomodoro_status enum('PLANNING','RETROSPECT','STUDYING','DONE')
  created_date datetime(6)
  last_modified_date datetime(6)
}

Ref member_to_refresh_token: member.id - refresh_token.member_id
Ref oauth_member_to_pomodoro_progress: member.id < pomodoro_progress.member_id
Ref fk_pomodoro_room_to_participant_code: pomodoro_room.participant_code_id - participant_code.id
Ref fk_pomodoro_progress_to_pomodoro_room: pomodoro_progress.pomodoro_room_id > pomodoro_room.id
Ref fk_pomodoro_progress_to_pomodoro_content: pomodoro_progress.id < pomodoro_content.pomodoro_progress_id
Clone this wiki locally