mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
Allow anonymous user colors in DB schema
Every authorship now has an author that saves the color. The author links to the session and optionally the user. For anonymous users, the session now can be used to reidentify the user. If the user is logged-in, the userId is saved into the author table. This allows to identify the user even after the session expired. A note created by an anonymous user does not have an owner. The cardinality was updated to reflect that. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
4205856b41
commit
fddb7e8c8c
1 changed files with 11 additions and 9 deletions
|
@ -74,7 +74,7 @@ entity "revision" {
|
|||
entity "authorship" {
|
||||
*id : uuid <<generated>>
|
||||
--
|
||||
*userId : uuid <FK user>>
|
||||
*authorId : uuid <FK user>>
|
||||
*startPos : number
|
||||
*endPos : number
|
||||
*createdAt : date
|
||||
|
@ -86,11 +86,12 @@ entity "revision_authorship" {
|
|||
*authorshipId : uuid <<FK authorship>>
|
||||
}
|
||||
|
||||
entity "author_colors" {
|
||||
*noteId : uuid <<FK note>>
|
||||
*userId : uuid <<FK user>>
|
||||
entity "author" {
|
||||
*id : number <<generated>>
|
||||
--
|
||||
*color : text
|
||||
sessionID : text <<FK session>>
|
||||
userId : uuid <<FK user>>
|
||||
}
|
||||
|
||||
|
||||
|
@ -148,22 +149,23 @@ entity "history_entry" {
|
|||
*updatedAt: date
|
||||
}
|
||||
|
||||
user "1" -- "0..*" note: owner
|
||||
user "0..1" -- "0..*" note: owner
|
||||
user "1" -u- "1..*" identity
|
||||
user "1" -l- "1..*" auth_token: authTokens
|
||||
user "1" -r- "1..*" session
|
||||
user "1" -- "0..*" media_upload
|
||||
user "1" - "0..*" history_entry
|
||||
user "1" -- "0..*" history_entry
|
||||
user "0..*" -- "0..*" note
|
||||
user "1" -- "0..*" authorship
|
||||
user "0..1" -- "0..*" author
|
||||
|
||||
(user, note) . author_colors
|
||||
author "1" -- "0..*" authorship
|
||||
author "1" -u- "0..*" session
|
||||
|
||||
revision "0..*" -- "0..*" authorship
|
||||
(revision, authorship) .. revision_authorship
|
||||
|
||||
media_upload "0..*" -- "1" note
|
||||
note "1" - "1..*" revision
|
||||
note "1" -d- "1..*" revision
|
||||
note "1" - "0..*" history_entry
|
||||
note "0..*" -l- "0..*" tag
|
||||
note "0..*" -- "0..*" group
|
||||
|
|
Loading…
Reference in a new issue