-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclinic.dbml
49 lines (43 loc) · 946 Bytes
/
clinic.dbml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Table clients {
id integer [pk]
first_name varchar(255) [not null]
last_name varchar(255) [not null]
patronym varchar(255) [null]
age integer [null]
}
Table doctors {
id integer [pk]
first_name varchar(255) [not null]
last_name varchar(255) [not null]
patronym varchar(255) [null]
age integer [null]
}
enum slot_status {
empty
scheduled
completed
canceled
}
Table slots {
id integer [pk]
doctor_id integer [not null]
client_id integer [null]
date date [not null]
start_time time [not null]
duration interval [not null]
status slot_status [not null]
}
enum cancellation_reason {
canceled_by_doctor
canceled_by_client
}
Table cancellations {
id integer [pk]
slot_id integer [not null]
reason cancellation_reason [not null]
doctor_comment varchar(4096) [null]
client_comment varchar(4096) [null]
}
Ref: slots.id - cancellations.slot_id
Ref: doctors.id < slots.doctor_id
Ref: clients.id < slots.client_id