-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.dbml
More file actions
69 lines (61 loc) · 1.78 KB
/
Copy pathdatabase.dbml
File metadata and controls
69 lines (61 loc) · 1.78 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
Table users {
id integer [pk, increment]
name varchar [not null]
username varchar [not null, unique]
web_username varchar [not null, unique]
git_username varchar [not null, unique]
git_email varchar [not null, unique]
email varchar [not null, unique]
avatar_url varchar
role varchar [not null, default: 'developer']
locale varchar [not null, default: 'en']
timezone varchar [not null, default: 'UTC']
preferred_language varchar [not null, default: 'en']
preferred_theme varchar [not null, default: 'light']
preferred_code_editor varchar [not null, default: 'vscode']
preferred_color_scheme varchar [not null, default: 'default']
deleted_at timestamp
created_at timestamp [not null, default: `now()`]
updated_at timestamp [not null, default: `now()`]
}
Table tasks {
id uuid [pk, default: `uuid_generate_v4()`]
user_id integer [not null]
title varchar [not null]
description text
is_completed boolean [not null, default: false]
due_date date
created_at timestamp [not null, default: `now()`]
updated_at timestamp [not null, default: `now()`]
}
Table projects {
id uuid [pk, default: `uuid_generate_v4()`]
user_id integer [not null]
name varchar [not null]
description text
created_at timestamp [not null, default: `now()`]
updated_at timestamp [not null, default: `now()`]
}
Table project_tasks {
project_id uuid [not null]
task_id uuid [not null]
indexes {
(project_id, task_id) [pk]
}
}
Table tags {
id integer [pk, increment]
name varchar [not null, unique]
created_at timestamp [not null, default: `now()`]
updated_at timestamp [not null, default: `now()`]
}
Table task_tags {
task_id integer [not null]
tag_id integer [not null]
indexes {
(task_id, tag_id) [pk]
}
}
Ref: users.id < tasks.user_id
Ref: tasks.id < task_tags.task_id
Ref: tags.id < task_tags.tag_id