-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathschema.dbml
More file actions
135 lines (117 loc) · 3.26 KB
/
schema.dbml
File metadata and controls
135 lines (117 loc) · 3.26 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Project Code_Mentoring {
database_type: 'PostgreSQL'
Note: 'learn.codementoring.co'
}
// ---------------------------------------------- User
Table User as U {
id uuid [pk, unique, not null]
firstName varchar [not null]
lastName varchar [not null]
email varchar [not null, unique]
createdAt timestamp [not null]
updatedAt timestamp
}
Table UserPreferences {
id uuid [pk, unique, not null]
userId uuid [ref: - U.id, not null]
practiceGoal integer [note: '1-4']
why varchar
codingAbility integer [note: '1-10']
}
// ---------------------------------------------- Path
Table Path {
id uuid [pk, unique, not null]
name varchar [not null, unique]
icon varchar [not null]
description varchar [not null]
createdAt timestamp [not null]
updatedAt timestamp
characterId uuid [ref: - Character.id, not null]
}
Table UserPath {
id uuid [pk, unique, not null]
userId uuid [ref: > U.id, not null]
pathId uuid [ref: > Path.id, not null]
completed boolean [not null]
joined timestamp [not null]
}
// ---------------------------------------------- Concept
Table Concept {
id uuid [pk, unique, not null]
name varchar [not null, unique]
description text [not null]
icon varchar [not null]
taughtIn uuid [ref: - M.id, not null]
}
Table UserConcepts {
userId uuid [ref: > U.id, not null]
conceptId uuid [ref: > Concept.id, not null]
learned timestamp [not null]
}
// ---------------------------------------------- Module
enum module_type {
lesson
assignment
}
Table Module as M{
id uuid [pk, unique, not null]
name varchar [not null, unique]
icon varchar [not null]
type module_type [not null, note: 'assignment OR lesson']
previous uuid [ref: > Module.id]
pathId uuid [ref: > Path.id, not null]
}
Table UserModule {
id uuid [pk, unique, not null]
userId uuid [ref: > U.id, not null]
moduleId uuid [ref: > M.id, not null]
completedAt timestamp
}
// ---------------------------------------------- Assignment
Table Assignment {
id uuid [pk, unique, not null]
moduleId uuid [ref: > M.id, not null]
description varchar [not null]
}
Table AssignmentFile as AF {
id uuid [pk, unique, not null]
author uuid [ref: > U.id, not null]
assignmentId uuid [ref: > Assignment.id, not null]
name varchar [not null]
type varchar [not null, note: 'Mimetype']
content text [not null]
}
// ---------------------------------------------- Lesson
Table Lesson as L {
id uuid [pk, unique, not null]
moduleId uuid [ref: > M.id, not null]
}
Table StorySection as SS {
id uuid [pk, unique, not null]
lessonId uuid [ref: > L.id, not null]
order int [not null]
content text [not null, note: "Markdown content"]
teaches uuid [ref: - Concept.id]
}
// ---------------------------------------------- Character
table Character {
id uuid [pk, unique, not null]
name varchar [not null, unique]
displayName varchar [not null, unique]
}
// ---------------------------------------------- Friends
table Friends {
user1Id uuid [ref: > U.id, not null]
user2Id uuid [ref: > U.id, not null]
since timestamp [not null]
}
table FriendRequests {
from uuid [ref: > U.id, not null]
to uuid [ref: > U.id, not null]
accepted boolean [note: '
null = Pending
true = create Friend join
false = Rejected
']
requested timestamp [not null]
}