// 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 start_time datetime duration int status status password string created_at datetime [default: `now()`] updated_at datetime [default: `now()`] } Table participant as P { 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()`] indexes { (account_id, meeting_id) [pk] // composite primary key } } 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] account_id participant_id [ref: > P.account_id] meeting_id participant_id [ref: > P.meeting_id] possible_date_id int [ref: > D.id] preference availability_preference start_time datetime end_time datetime created_at datetime [default: `now()`] } Enum status { 0_proposed 1_confirmed } Enum availability_preference { 0_yes 1_ideal }