docs(erd): add is_deleted column to data.files
This commit is contained in:
parent
828d611f4d
commit
78885b3656
421
docs/erd.puml
421
docs/erd.puml
@ -1,210 +1,211 @@
|
|||||||
@startuml Tanabata File Manager entity relationship diagram
|
@startuml Tanabata File Manager entity relationship diagram
|
||||||
|
|
||||||
' skinparam linetype ortho
|
' skinparam linetype ortho
|
||||||
|
|
||||||
|
|
||||||
' ========== SYSTEM ==========
|
' ========== SYSTEM ==========
|
||||||
|
|
||||||
entity "system.users" as usr {
|
entity "system.users" as usr {
|
||||||
* id : smallserial <<generated>>
|
* id : smallserial <<generated>>
|
||||||
--
|
--
|
||||||
* name : varchar(32)
|
* name : varchar(32)
|
||||||
* password : text
|
* password : text
|
||||||
* is_admin : boolean
|
* is_admin : boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
entity "system.mime" as mime {
|
entity "system.mime" as mime {
|
||||||
* id : smallserial <<generated>>
|
* id : smallserial <<generated>>
|
||||||
--
|
--
|
||||||
* name : varchar(127)
|
* name : varchar(127)
|
||||||
* extension : varchar(16)
|
* extension : varchar(16)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
' ========== DATA ==========
|
' ========== DATA ==========
|
||||||
|
|
||||||
entity "data.categories" as cty {
|
entity "data.categories" as cty {
|
||||||
* id : uuid <<generated>>
|
* id : uuid <<generated>>
|
||||||
--
|
--
|
||||||
* name : varchar(256)
|
* name : varchar(256)
|
||||||
notes : text
|
notes : text
|
||||||
color : char(6)
|
color : char(6)
|
||||||
' * created_at : timestamptz <<generated>>
|
' * created_at : timestamptz <<generated>>
|
||||||
* creator_id : smallint
|
* creator_id : smallint
|
||||||
' * is_private : boolean
|
' * is_private : boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
cty::creator_id }o--|| usr::id
|
cty::creator_id }o--|| usr::id
|
||||||
|
|
||||||
entity "data.files" as fle {
|
entity "data.files" as fle {
|
||||||
* id : uuid <<generated>>
|
* id : uuid <<generated>>
|
||||||
--
|
--
|
||||||
name : varchar(256)
|
name : varchar(256)
|
||||||
* mime_id : smallint
|
* mime_id : smallint
|
||||||
* datetime : timestamptz
|
* datetime : timestamptz
|
||||||
notes : text
|
notes : text
|
||||||
* metadata : jsonb
|
* metadata : jsonb
|
||||||
' * created_at : timestamptz <<generated>>
|
' * created_at : timestamptz <<generated>>
|
||||||
* creator_id : smallint
|
* creator_id : smallint
|
||||||
' * is_private : boolean
|
' * is_private : boolean
|
||||||
}
|
* is_deleted : boolean
|
||||||
|
}
|
||||||
fle::mime_id }o--|| mime::id
|
|
||||||
fle::creator_id }o--|| usr::id
|
fle::mime_id }o--|| mime::id
|
||||||
|
fle::creator_id }o--|| usr::id
|
||||||
entity "data.tags" as tag {
|
|
||||||
* id : uuid <<generated>>
|
entity "data.tags" as tag {
|
||||||
--
|
* id : uuid <<generated>>
|
||||||
* name : varchar(256)
|
--
|
||||||
notes : text
|
* name : varchar(256)
|
||||||
color : char(6)
|
notes : text
|
||||||
category_id : uuid
|
color : char(6)
|
||||||
' * created_at : timestamptz <<generated>>
|
category_id : uuid
|
||||||
* creator_id : smallint
|
' * created_at : timestamptz <<generated>>
|
||||||
' * is_private : boolean
|
* creator_id : smallint
|
||||||
}
|
' * is_private : boolean
|
||||||
|
}
|
||||||
tag::category_id }o--o| cty::id
|
|
||||||
tag::creator_id }o--|| usr::id
|
tag::category_id }o--o| cty::id
|
||||||
|
tag::creator_id }o--|| usr::id
|
||||||
entity "data.file_tag" as ft {
|
|
||||||
* file_id : uuid
|
entity "data.file_tag" as ft {
|
||||||
* tag_id : uuid
|
* file_id : uuid
|
||||||
}
|
* tag_id : uuid
|
||||||
|
}
|
||||||
ft::file_id }o--|| fle::id
|
|
||||||
ft::tag_id }o--|| tag::id
|
ft::file_id }o--|| fle::id
|
||||||
|
ft::tag_id }o--|| tag::id
|
||||||
entity "data.autotags" as atg {
|
|
||||||
* trigger_tag_id : uuid
|
entity "data.autotags" as atg {
|
||||||
* add_tag_id : uuid
|
* trigger_tag_id : uuid
|
||||||
--
|
* add_tag_id : uuid
|
||||||
* is_active : boolean
|
--
|
||||||
}
|
* is_active : boolean
|
||||||
|
}
|
||||||
atg::trigger_tag_id }o--|| tag::id
|
|
||||||
atg::add_tag_id }o--|| tag::id
|
atg::trigger_tag_id }o--|| tag::id
|
||||||
|
atg::add_tag_id }o--|| tag::id
|
||||||
entity "data.pools" as pool {
|
|
||||||
* id : uuid <<generated>>
|
entity "data.pools" as pool {
|
||||||
--
|
* id : uuid <<generated>>
|
||||||
* name : varchar(256)
|
--
|
||||||
notes : text
|
* name : varchar(256)
|
||||||
' parent_id : uuid
|
notes : text
|
||||||
' * created_at : timestamptz
|
' parent_id : uuid
|
||||||
* creator_id : smallint
|
' * created_at : timestamptz
|
||||||
' * is_private : boolean
|
* creator_id : smallint
|
||||||
}
|
' * is_private : boolean
|
||||||
|
}
|
||||||
pool::creator_id }o--|| usr::id
|
|
||||||
' pool::parent_id }o--o| pool::id
|
pool::creator_id }o--|| usr::id
|
||||||
|
' pool::parent_id }o--o| pool::id
|
||||||
entity "data.file_pool" as fp {
|
|
||||||
* file_id : uuid
|
entity "data.file_pool" as fp {
|
||||||
* pool_id : uuid
|
* file_id : uuid
|
||||||
* number : smallint
|
* pool_id : uuid
|
||||||
}
|
* number : smallint
|
||||||
|
}
|
||||||
fp::file_id }o--|| fle::id
|
|
||||||
fp::pool_id }o--|| pool::id
|
fp::file_id }o--|| fle::id
|
||||||
|
fp::pool_id }o--|| pool::id
|
||||||
|
|
||||||
' ========== ACL ==========
|
|
||||||
|
' ========== ACL ==========
|
||||||
entity "acl.files" as acl_f {
|
|
||||||
* user_id : smallint
|
entity "acl.files" as acl_f {
|
||||||
* file_id : uuid
|
* user_id : smallint
|
||||||
--
|
* file_id : uuid
|
||||||
* view : boolean
|
--
|
||||||
* edit : boolean
|
* view : boolean
|
||||||
}
|
* edit : boolean
|
||||||
|
}
|
||||||
acl_f::user_id }o--|| usr::id
|
|
||||||
acl_f::file_id }o--|| fle::id
|
acl_f::user_id }o--|| usr::id
|
||||||
|
acl_f::file_id }o--|| fle::id
|
||||||
entity "acl.tags" as acl_t {
|
|
||||||
* user_id : smallint
|
entity "acl.tags" as acl_t {
|
||||||
* tag_id : uuid
|
* user_id : smallint
|
||||||
--
|
* tag_id : uuid
|
||||||
* view : boolean
|
--
|
||||||
* edit : boolean
|
* view : boolean
|
||||||
' * files_view : boolean
|
* edit : boolean
|
||||||
' * files_edit : boolean
|
' * files_view : boolean
|
||||||
}
|
' * files_edit : boolean
|
||||||
|
}
|
||||||
acl_t::user_id }o--|| usr::id
|
|
||||||
acl_t::tag_id }o--|| tag::id
|
acl_t::user_id }o--|| usr::id
|
||||||
|
acl_t::tag_id }o--|| tag::id
|
||||||
entity "acl.categories" as acl_c {
|
|
||||||
* user_id : smallint
|
entity "acl.categories" as acl_c {
|
||||||
* category_id : uuid
|
* user_id : smallint
|
||||||
--
|
* category_id : uuid
|
||||||
* view : boolean
|
--
|
||||||
* edit : boolean
|
* view : boolean
|
||||||
' * tags_view : boolean
|
* edit : boolean
|
||||||
' * tags_edit : boolean
|
' * tags_view : boolean
|
||||||
}
|
' * tags_edit : boolean
|
||||||
|
}
|
||||||
acl_c::user_id }o--|| usr::id
|
|
||||||
acl_c::category_id }o--|| cty::id
|
acl_c::user_id }o--|| usr::id
|
||||||
|
acl_c::category_id }o--|| cty::id
|
||||||
entity "acl.pools" as acl_p {
|
|
||||||
* user_id : smallint
|
entity "acl.pools" as acl_p {
|
||||||
* pool_id : uuid
|
* user_id : smallint
|
||||||
--
|
* pool_id : uuid
|
||||||
* view : boolean
|
--
|
||||||
* edit : boolean
|
* view : boolean
|
||||||
' * files_view : boolean
|
* edit : boolean
|
||||||
' * files_edit : boolean
|
' * files_view : boolean
|
||||||
}
|
' * files_edit : boolean
|
||||||
|
}
|
||||||
acl_p::user_id }o--|| usr::id
|
|
||||||
acl_p::pool_id }o--|| pool::id
|
acl_p::user_id }o--|| usr::id
|
||||||
|
acl_p::pool_id }o--|| pool::id
|
||||||
|
|
||||||
' ========== ACTIVITY ==========
|
|
||||||
|
' ========== ACTIVITY ==========
|
||||||
entity "activity.sessions" as ssn {
|
|
||||||
* id : serial <<generated>>
|
entity "activity.sessions" as ssn {
|
||||||
--
|
* id : serial <<generated>>
|
||||||
* token : text
|
--
|
||||||
* user_id : smallint
|
* token : text
|
||||||
* user_agent : varchar(512)
|
* user_id : smallint
|
||||||
* started_at : timestamptz
|
* user_agent : varchar(512)
|
||||||
expires_at : timestamptz
|
* started_at : timestamptz
|
||||||
* last_activity : timestamptz
|
expires_at : timestamptz
|
||||||
}
|
* last_activity : timestamptz
|
||||||
|
}
|
||||||
ssn::user_id }o--|| usr::id
|
|
||||||
|
ssn::user_id }o--|| usr::id
|
||||||
entity "activity.file_views" as fv {
|
|
||||||
* file_id : uuid
|
entity "activity.file_views" as fv {
|
||||||
* timestamp : timestamptz
|
* file_id : uuid
|
||||||
* user_id : smallint
|
* timestamp : timestamptz
|
||||||
}
|
* user_id : smallint
|
||||||
|
}
|
||||||
fv::file_id }o--|| fle::id
|
|
||||||
fv::user_id }o--|| usr::id
|
fv::file_id }o--|| fle::id
|
||||||
|
fv::user_id }o--|| usr::id
|
||||||
entity "activity.tag_uses" as tu {
|
|
||||||
* tag_id : uuid
|
entity "activity.tag_uses" as tu {
|
||||||
* timestamp : timestamptz
|
* tag_id : uuid
|
||||||
* user_id : smallint
|
* timestamp : timestamptz
|
||||||
--
|
* user_id : smallint
|
||||||
* included : boolean
|
--
|
||||||
}
|
* included : boolean
|
||||||
|
}
|
||||||
tu::tag_id }o--|| tag::id
|
|
||||||
tu::user_id }o--|| usr::id
|
tu::tag_id }o--|| tag::id
|
||||||
|
tu::user_id }o--|| usr::id
|
||||||
entity "activity.pool_views" as pv {
|
|
||||||
* pool_id : uuid
|
entity "activity.pool_views" as pv {
|
||||||
* timestamp : timestamptz
|
* pool_id : uuid
|
||||||
* user_id : smallint
|
* timestamp : timestamptz
|
||||||
}
|
* user_id : smallint
|
||||||
|
}
|
||||||
pv::pool_id }o--|| pool::id
|
|
||||||
pv::user_id }o--|| usr::id
|
pv::pool_id }o--|| pool::id
|
||||||
|
pv::user_id }o--|| usr::id
|
||||||
|
|
||||||
@enduml
|
|
||||||
|
@enduml
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user