-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbrainwriter-database.dbml
47 lines (39 loc) · 1.24 KB
/
brainwriter-database.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
Project Brainwriter {
database_type: 'PostgreSQL'
note: '''
# Brainwriter Database
### Topics
One Round of Brainwriting consists of exactly one topic.
It defines which problem will be discussed, how much time per round is available and how to join.
### ChatMessages
Every Comment in each column during a round of Brainwriting resembles a ChatMessage.
It is called "ChatMessage" because the App at its core is basically a chatroom with restrictions.
### Authors
An Author is everyone who joins a Session and may write messages/ideas.
'''
}
Table Topics {
id int [pk, increment]
topic varchar
joinCode varchar [unique]
timePerRound int [not null, default: 180]
joinable boolean [not null]
createdAt timestamp [not null, default: `now()`]
updatedAt timestamp [not null, default: `now()`]
}
Table ChatMessages {
id int [pk, increment]
authorID int [ref: > Authors.id]
content varchar [not null]
column int [not null]
row int [not null]
createdAt timestamp [not null, default: `now()`]
updatedAt timestamp [not null, default: `now()`]
}
Table Authors {
id int [pk, increment]
userName varchar [unique]
topicID int [ref: > Topics.id]
createdAt timestamp [not null, default: `now()`]
updatedAt timestamp [not null, default: `now()`]
}