-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.dbml
More file actions
44 lines (40 loc) · 1.04 KB
/
db.dbml
File metadata and controls
44 lines (40 loc) · 1.04 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
Table profiles as prof {
user_id integer [pk]
user_name varchar [not null]
password varchar
Date datetime [not null, default: `now()`]
Indexes {
user_id [unique, name: "idx_profiles_user_id"]
}
}
Table image as im {
image_id integer [pk, increment]
user_id integer
image_name varchar [pk, not null]
caption varchar
tag_id integer [ref: > Tags.tag_id]
Date datetime [not null, default: `now()`]
Indexes {
user_id [unique, name: "idx_profiles_user_id"]
tag_id [name: "idx_image_tag_id"]
}
}
Table Text as txt {
text_id integer [pk, increment]
user_id integer
caption varchar [not null]
Date datetime [not null, default: `now()`]
Indexes {
user_id [unique, name: "idx_profiles_user_id"]
}
}
Table Tags {
tag_id integer [pk, increment]
tag_name varchar [not null]
Date datetime [not null, default: `now()`]
Indexes {
tag_id [unique, name: "idx_tags_tag_id"]
}
}
Ref: im.user_id > prof.user_id
Ref: prof.user_id > txt.user_id