-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.dbml
54 lines (44 loc) · 1.21 KB
/
schema.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
50
51
52
53
54
enum question_type {
multiple_choice
select_all
}
table answers {
id serial [pk, not null, increment]
question_id integer [not null]
answer_choices text[] [not null]
}
table polls {
id serial [pk, not null, increment]
user_id text [not null]
is_request boolean [not null, default: false]
is_active boolean [not null, default: false]
is_completed boolean [not null, default: false]
title text [not null]
suggested_duration integer
comment text [default: `NULL`]
created_at timestamp [not null, default: `now()`]
ends_at timestamp [not null]
}
table questions {
id serial [pk, not null, increment]
poll_id integer [not null]
order integer [not null]
question_type question_type [not null]
question text [not null]
answer_choices text[] [not null]
}
table user_has_done_poll {
user_id text [not null]
poll_id integer [not null]
}
table users {
netid text [pk, not null]
email text [not null]
is_admin boolean [not null, default: false]
is_email_list boolean [not null, default: false]
}
ref: answers.question_id > questions.id
ref: polls.user_id > users.netid
ref: questions.poll_id > polls.id
ref: user_has_done_poll.poll_id > polls.id
ref: user_has_done_poll.user_id > users.netid