2020-08-26 11:14:52 +00:00
|
|
|
// DBML source code of the database
|
|
|
|
// Use https://dbdiagram.io to visualize it
|
|
|
|
|
|
|
|
Project meeting_planner {
|
|
|
|
database_type: 'PostgreSQL'
|
|
|
|
}
|
|
|
|
|
|
|
|
Table account as A {
|
|
|
|
id int [pk, unique, increment] // auto-increment, uuid
|
|
|
|
username string
|
|
|
|
email string
|
|
|
|
password string
|
|
|
|
timezone string
|
|
|
|
earliest_time string
|
|
|
|
latest_time string
|
|
|
|
created_at datetime [default: `now()`]
|
|
|
|
updated_at datetime [default: `now()`]
|
|
|
|
}
|
|
|
|
|
|
|
|
Table meeting as M {
|
|
|
|
id uuid [pk, unique]
|
|
|
|
title string
|
|
|
|
description string
|
2020-08-26 15:19:46 +00:00
|
|
|
start_time datetime
|
2020-08-26 11:14:52 +00:00
|
|
|
duration int
|
|
|
|
status status
|
|
|
|
password string
|
|
|
|
created_at datetime [default: `now()`]
|
|
|
|
updated_at datetime [default: `now()`]
|
|
|
|
}
|
|
|
|
|
|
|
|
Table participant as P {
|
2020-08-28 18:54:21 +00:00
|
|
|
id uuid [pk, unique]
|
|
|
|
email string
|
2020-08-26 11:14:52 +00:00
|
|
|
account_id int [ref: > A.id]
|
|
|
|
meeting_id uuid [ref: > M.id]
|
|
|
|
quorum boolean
|
|
|
|
mandatory boolean
|
|
|
|
host boolean
|
|
|
|
answered boolean
|
|
|
|
created_at datetime [default: `now()`]
|
|
|
|
updated_at datetime [default: `now()`]
|
|
|
|
}
|
|
|
|
|
|
|
|
Table possible_date as D {
|
|
|
|
id int [pk, increment, unique]
|
|
|
|
meeting_id string [ref: > M.id]
|
|
|
|
possible_date string
|
|
|
|
created_at datetime [default: `now()`]
|
|
|
|
}
|
|
|
|
|
|
|
|
Table availability {
|
|
|
|
id int [pk, increment, unique]
|
2020-08-28 18:54:21 +00:00
|
|
|
participant_id string [ref: > P.id]
|
2020-08-26 11:14:52 +00:00
|
|
|
possible_date_id int [ref: > D.id]
|
|
|
|
preference availability_preference
|
2020-08-26 15:19:46 +00:00
|
|
|
start_time datetime
|
|
|
|
end_time datetime
|
2020-08-26 11:14:52 +00:00
|
|
|
created_at datetime [default: `now()`]
|
|
|
|
}
|
|
|
|
|
|
|
|
Enum status {
|
|
|
|
0_proposed
|
|
|
|
1_confirmed
|
|
|
|
}
|
|
|
|
|
|
|
|
Enum availability_preference {
|
|
|
|
0_yes
|
|
|
|
1_ideal
|
|
|
|
}
|