diff --git a/code/db/ERP.png b/code/db/ERP.png index 1e606e9..2145b21 100644 Binary files a/code/db/ERP.png and b/code/db/ERP.png differ diff --git a/code/db/README.md b/code/db/README.md index f971e59..c858620 100644 --- a/code/db/README.md +++ b/code/db/README.md @@ -1,7 +1,6 @@ This is DBML Code. It can be edited and viewed on [dbdiagram.io](https://dbdiagram.io/d) ``` -// Use DBML to define your database structure // Docs: https://dbml.dbdiagram.io/docs Table follows { @@ -16,18 +15,28 @@ Table users { role varchar email string password string + profile_picture integer + bio string created_at timestamp } Table posts { id integer [primary key] - title varchar - body text [note: 'Content of the post'] + description varchar user_id integer [not null] status varchar - file string created_at timestamp } +Table media { + id integer [primary key] + path string + created_at timestamp +} + +Table post_media { + media_id integer + post_id integer +} Table comments { id integer [primary key] @@ -55,6 +64,9 @@ Table post_tags { Ref: post_tags.post_id > posts.id Ref: post_tags.tag_id > tags.id +Ref: post_media.post_id < posts.id +Ref: post_media.media_id < media.id +Ref: users.profile_picture < media.id Ref: likes.user_id < users.id @@ -68,4 +80,5 @@ Ref: users.id < follows.following_user_id Ref: users.id < follows.followed_user_id + ```