-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.dbml
More file actions
39 lines (33 loc) · 898 Bytes
/
database.dbml
File metadata and controls
39 lines (33 loc) · 898 Bytes
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
Table users {
id integer [pk, increment]
name varchar [not null]
email varchar [not null, unique]
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 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