2020-07-27 16:35:12 -04:00
|
|
|
@startuml
|
|
|
|
' hide the spot
|
|
|
|
hide circle
|
|
|
|
|
|
|
|
' avoid problems with angled crows feet
|
|
|
|
skinparam linetype ortho
|
|
|
|
|
2020-08-12 13:47:22 -04:00
|
|
|
entity "Note" {
|
2020-07-27 16:35:12 -04:00
|
|
|
*id : uuid <<generated>>
|
|
|
|
--
|
|
|
|
*shortid : text
|
|
|
|
*alias : text
|
|
|
|
*viewcount : number
|
2020-08-12 13:47:22 -04:00
|
|
|
*ownerId : uuid <<FK User>>
|
2020-07-27 16:35:12 -04:00
|
|
|
}
|
|
|
|
|
2020-08-12 13:47:22 -04:00
|
|
|
entity "User" {
|
2020-07-27 16:35:12 -04:00
|
|
|
*id : uuid <<generated>>
|
|
|
|
--
|
2020-08-12 13:47:22 -04:00
|
|
|
*userName : text
|
|
|
|
*displayName : text
|
|
|
|
*createdAt : date
|
|
|
|
*updatedAt : date
|
|
|
|
photo : text
|
|
|
|
email : text
|
|
|
|
}
|
|
|
|
|
|
|
|
entity "AuthToken" as authToken{
|
|
|
|
*id : number <<generated>>
|
|
|
|
--
|
|
|
|
*userId : uuid
|
|
|
|
*accessToken : text
|
|
|
|
}
|
|
|
|
|
|
|
|
entity "Identity" {
|
|
|
|
*id : number
|
|
|
|
--
|
|
|
|
*userId : uuid <<FK User>>
|
|
|
|
' Identifies the external login provider and is set in the config
|
|
|
|
*providerName : text
|
|
|
|
*syncSource : boolean
|
|
|
|
*createdAt : date
|
|
|
|
*updatedAt : date
|
|
|
|
' The unique identifier of a user from the login provider
|
|
|
|
providerUserId : text
|
|
|
|
' Token used to access the OAuth provider in the users name. Can be NULL
|
|
|
|
oauthAccessToken : text
|
|
|
|
' Password hash. Can be NULL
|
|
|
|
passwordHash : text
|
2020-07-27 16:35:12 -04:00
|
|
|
}
|
|
|
|
|
2020-08-12 13:47:22 -04:00
|
|
|
entity "Session" as seesion {
|
|
|
|
*id : text
|
|
|
|
--
|
|
|
|
*expiredAt : number
|
|
|
|
*json : text
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
entity "Revision" {
|
2020-07-27 16:35:12 -04:00
|
|
|
*id : uuid <<generated>>
|
|
|
|
--
|
2020-08-12 13:47:22 -04:00
|
|
|
*noteId : uuid <<FK Note>>
|
2020-07-27 16:35:12 -04:00
|
|
|
*content : text
|
|
|
|
*patch : text
|
|
|
|
*createdAt : date
|
|
|
|
*length : number
|
|
|
|
}
|
|
|
|
|
2020-08-12 13:47:22 -04:00
|
|
|
entity "Authorship" {
|
2020-07-27 16:35:12 -04:00
|
|
|
*id : uuid <<generated>>
|
|
|
|
--
|
2020-08-12 13:47:22 -04:00
|
|
|
*userId : uuid <FK User>>
|
2020-07-27 16:35:12 -04:00
|
|
|
*startPos : number
|
|
|
|
*endPos : number
|
|
|
|
*createdAt : date
|
|
|
|
*updatedAt : date
|
|
|
|
}
|
|
|
|
|
|
|
|
entity "RevisionAuthorship" {
|
2020-08-12 13:47:22 -04:00
|
|
|
*revisionId : uuid <<FK Revision>>
|
|
|
|
*authorshipId : uuid <<FK Authorship>>
|
2020-07-27 16:35:12 -04:00
|
|
|
}
|
|
|
|
|
2020-08-12 13:47:22 -04:00
|
|
|
entity "AuthorColors" {
|
|
|
|
*noteId : uuid <<FK Note>>
|
|
|
|
*userId : uuid <<FK User>>
|
|
|
|
--
|
|
|
|
*color : text
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-27 16:35:12 -04:00
|
|
|
entity "NoteUserPermission" {
|
2020-08-12 13:47:22 -04:00
|
|
|
*userId : uuid <<FK User>>
|
|
|
|
*noteId : uuid <<FK Note>>
|
2020-07-27 16:35:12 -04:00
|
|
|
--
|
|
|
|
*canEdit : boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
entity "Group" {
|
|
|
|
*id : number <<generated>>
|
|
|
|
--
|
|
|
|
*name : text <<unique>>
|
|
|
|
*displayName : text
|
|
|
|
' Is set to denote a special group
|
|
|
|
' Special groups are used to map the old share settings like "everyone can edit"
|
2020-08-12 13:47:22 -04:00
|
|
|
' or "logged in users can view" to the group permission system
|
2020-07-27 16:35:12 -04:00
|
|
|
*special : boolean
|
|
|
|
}
|
2020-08-12 13:47:22 -04:00
|
|
|
|
2020-07-27 16:35:12 -04:00
|
|
|
entity "NoteGroupPermission" {
|
2020-08-12 13:47:22 -04:00
|
|
|
*groupId : number <<FK Group>>
|
|
|
|
*noteId : uuid <<FK Note>>
|
2020-07-27 16:35:12 -04:00
|
|
|
--
|
|
|
|
*canEdit : boolean
|
|
|
|
}
|
|
|
|
|
2020-09-19 09:48:00 -04:00
|
|
|
Note "1" - "1..*" Revision
|
|
|
|
Revision "0..*" - "0..*" Authorship
|
2020-08-12 13:47:22 -04:00
|
|
|
(Revision, Authorship) .. RevisionAuthorship
|
2020-08-29 12:37:53 -04:00
|
|
|
Authorship "0..*" -- "1" User
|
2020-09-19 09:48:00 -04:00
|
|
|
Note "0..*" -- "1" User : owner
|
2020-08-29 12:37:53 -04:00
|
|
|
Note "1" -- "0..*" NoteUserPermission
|
|
|
|
NoteUserPermission "1" -- "1" User
|
|
|
|
Note "1" -- "0..*" NoteGroupPermission
|
|
|
|
NoteGroupPermission "0..*" -- "1" Group
|
|
|
|
Identity "1..*" -- "1" User
|
|
|
|
authToken "1..*" -- "1" User
|
|
|
|
seesion "1..*" -- "1" User
|
|
|
|
Note "0..*" -- "0..*" User : color
|
2020-08-12 13:47:22 -04:00
|
|
|
(Note, User) .. AuthorColors
|
|
|
|
@enduml
|