-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.dbml
36 lines (31 loc) · 919 Bytes
/
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
Project mefeto {
database_type: 'PostgreSQL'
}
Table articles as A {
id int [pk, increment]
title varchar [not null]
thumbnail_url varchar [not null]
short_description text
categories varchar[] [not null]
content text [not null, note: 'HTML content']
boundary int [default: 35]
author_id varchar [not null]
created_at timestamp [not null, default: `now()`]
}
Table article_upvotes {
article_id int [pk, not null, ref: > A.id]
user_id varchar [pk, not null]
created_at timestamp [not null, default: `now()`]
}
Table article_comments {
id int [pk, increment]
article_id int [not null, ref: > A.id]
user_id varchar [not null]
content text [not null]
created_at timestamp [not null, default: `now()`]
}
Table article_comment_upvotes {
comment_id int [pk, not null, ref: > article_comments.id]
user_id varchar [pk, not null]
created_at timestamp [not null, default: `now()`]
}