docs(erd): addsurrogate PK to mime table and change some ID types to numeric
This commit is contained in:
parent
e8084bdeb0
commit
1c013183f0
@ -6,7 +6,7 @@
|
||||
' ========== SYSTEM ==========
|
||||
|
||||
entity "system.users" as usr {
|
||||
* id : uuid <<generated>>
|
||||
* id : smallserial <<generated>>
|
||||
--
|
||||
* name : varchar(32)
|
||||
* password : text
|
||||
@ -14,8 +14,9 @@ entity "system.users" as usr {
|
||||
}
|
||||
|
||||
entity "system.mime" as mime {
|
||||
* name : varchar(127)
|
||||
* id : smallserial <<generated>>
|
||||
--
|
||||
* name : varchar(127)
|
||||
* extension : varchar(16)
|
||||
}
|
||||
|
||||
@ -29,7 +30,7 @@ entity "data.categories" as cty {
|
||||
notes : text
|
||||
color : char(6)
|
||||
* created_at : timestamptz <<generated>>
|
||||
* creator_id : uuid
|
||||
* creator_id : smallint
|
||||
' * is_private : boolean
|
||||
}
|
||||
|
||||
@ -39,16 +40,16 @@ entity "data.files" as fle {
|
||||
* id : uuid <<generated>>
|
||||
--
|
||||
name : varchar(256)
|
||||
* mime : varchar(127)
|
||||
* mime_id : smallint
|
||||
* datetime : timestamptz
|
||||
notes : text
|
||||
* metadata : jsonb
|
||||
* created_at : timestamptz <<generated>>
|
||||
* creator_id : uuid
|
||||
* creator_id : smallint
|
||||
' * is_private : boolean
|
||||
}
|
||||
|
||||
fle::mime }o--|| mime::name
|
||||
fle::mime_id }o--|| mime::id
|
||||
fle::creator_id }o--|| usr::id
|
||||
|
||||
entity "data.tags" as tag {
|
||||
@ -59,7 +60,7 @@ entity "data.tags" as tag {
|
||||
color : char(6)
|
||||
category_id : uuid
|
||||
* created_at : timestamptz <<generated>>
|
||||
* creator_id : uuid
|
||||
* creator_id : smallint
|
||||
' * is_private : boolean
|
||||
}
|
||||
|
||||
@ -91,7 +92,7 @@ entity "data.pools" as pool {
|
||||
notes : text
|
||||
' parent_id : uuid
|
||||
* created_at : timestamptz
|
||||
* creator_id : uuid
|
||||
* creator_id : smallint
|
||||
' * is_private : boolean
|
||||
}
|
||||
|
||||
@ -101,7 +102,7 @@ pool::creator_id }o--|| usr::id
|
||||
entity "data.file_pool" as fp {
|
||||
* file_id : uuid
|
||||
* pool_id : uuid
|
||||
* number : integer
|
||||
* number : smallint
|
||||
}
|
||||
|
||||
fp::file_id }o--|| fle::id
|
||||
@ -111,7 +112,7 @@ fp::pool_id }o--|| pool::id
|
||||
' ========== ACCESS ==========
|
||||
|
||||
entity "access.files" as acl_f {
|
||||
* user_id : uuid
|
||||
* user_id : smallint
|
||||
* file_id : uuid
|
||||
--
|
||||
* read : boolean
|
||||
@ -122,7 +123,7 @@ acl_f::user_id }o--|| usr::id
|
||||
acl_f::file_id }o--|| fle::id
|
||||
|
||||
entity "access.tags" as acl_t {
|
||||
* user_id : uuid
|
||||
* user_id : smallint
|
||||
* tag_id : uuid
|
||||
--
|
||||
* read : boolean
|
||||
@ -135,7 +136,7 @@ acl_t::user_id }o--|| usr::id
|
||||
acl_t::tag_id }o--|| tag::id
|
||||
|
||||
entity "access.categories" as acl_c {
|
||||
* user_id : uuid
|
||||
* user_id : smallint
|
||||
* category_id : uuid
|
||||
--
|
||||
* read : boolean
|
||||
@ -148,7 +149,7 @@ acl_c::user_id }o--|| usr::id
|
||||
acl_c::category_id }o--|| cty::id
|
||||
|
||||
entity "access.pools" as acl_p {
|
||||
* user_id : uuid
|
||||
* user_id : smallint
|
||||
* pool_id : uuid
|
||||
--
|
||||
* read : boolean
|
||||
@ -166,7 +167,7 @@ acl_p::pool_id }o--|| pool::id
|
||||
entity "activity.sessions" as ssn {
|
||||
* id : uuid <<generated>>
|
||||
--
|
||||
* user_id : uuid
|
||||
* user_id : smallint
|
||||
* user_agent : varchar(512)
|
||||
* started_at : timestamptz
|
||||
expires_at : timestamptz
|
||||
@ -178,7 +179,7 @@ ssn::user_id }o--|| usr::id
|
||||
entity "activity.file_views" as fv {
|
||||
* file_id : uuid
|
||||
* timestamp : timestamptz
|
||||
* user_id : uuid
|
||||
* user_id : smallint
|
||||
}
|
||||
|
||||
fv::file_id }o--|| fle::id
|
||||
@ -187,7 +188,7 @@ fv::user_id }o--|| usr::id
|
||||
entity "activity.tag_uses" as tu {
|
||||
* tag_id : uuid
|
||||
* timestamp : timestamptz
|
||||
* user_id : uuid
|
||||
* user_id : smallint
|
||||
--
|
||||
* included : boolean
|
||||
}
|
||||
@ -198,7 +199,7 @@ tu::user_id }o--|| usr::id
|
||||
entity "activity.pool_views" as pv {
|
||||
* pool_id : uuid
|
||||
* timestamp : timestamptz
|
||||
* user_id : uuid
|
||||
* user_id : smallint
|
||||
}
|
||||
|
||||
pv::pool_id }o--|| pool::id
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user