2020-07-27 16:35:12 -04:00
|
|
|
@startuml
|
|
|
|
hide circle
|
2020-10-24 14:55:31 -04:00
|
|
|
skinparam nodesep 60
|
2020-07-27 16:35:12 -04:00
|
|
|
|
2020-08-12 13:47:22 -04:00
|
|
|
entity "Note" {
|
2020-07-27 16:35:12 -04:00
|
|
|
*id : uuid <<generated>>
|
|
|
|
--
|
|
|
|
*shortid : text
|
2020-10-03 05:14:41 -04:00
|
|
|
alias : text
|
2020-07-27 16:35:12 -04:00
|
|
|
*viewcount : number
|
2020-08-12 13:47:22 -04:00
|
|
|
*ownerId : uuid <<FK User>>
|
2020-10-03 05:02:03 -04:00
|
|
|
description: text
|
|
|
|
title: text
|
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-10-03 05:02:03 -04:00
|
|
|
entity "Session" {
|
2020-08-12 13:47:22 -04:00
|
|
|
*id : text
|
|
|
|
--
|
|
|
|
*expiredAt : number
|
|
|
|
*json : text
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
entity "Revision" {
|
2020-09-22 14:06:16 -04:00
|
|
|
*id : number <<generated>>
|
2020-07-27 16:35:12 -04:00
|
|
|
--
|
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-09-22 14:06:16 -04:00
|
|
|
*revisionId : number <<FK Revision>>
|
2020-08-12 13:47:22 -04:00
|
|
|
*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-10-03 05:02:03 -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-10-03 05:02:03 -04:00
|
|
|
entity "Tag" {
|
|
|
|
*id: number <<generated>>
|
|
|
|
*name: text
|
|
|
|
}
|
|
|
|
|
2020-10-13 04:19:12 -04:00
|
|
|
entity "MediaUpload" {
|
|
|
|
*id : text <<unique>>
|
|
|
|
--
|
|
|
|
*noteId : uuid <<FK Note>>
|
|
|
|
*userId : uuid <<FK User>>
|
|
|
|
*backendType: text
|
|
|
|
backendData: text
|
|
|
|
*createdAt : date
|
|
|
|
}
|
|
|
|
|
2020-10-24 14:55:31 -04:00
|
|
|
User "1" -- "0..*" Note: owner
|
|
|
|
User "1" -u- "1..*" Identity
|
|
|
|
User "1" - "1..*" authToken
|
|
|
|
User "1" -l- "1..*" Session
|
|
|
|
User "1" - "0..*" MediaUpload
|
|
|
|
User "0..*" -- "0..*" Note
|
|
|
|
User "1" - "0..*" Authorship
|
|
|
|
|
|
|
|
(User, Note) . AuthorColors
|
|
|
|
|
2020-09-19 09:48:00 -04:00
|
|
|
Revision "0..*" - "0..*" Authorship
|
2020-08-12 13:47:22 -04:00
|
|
|
(Revision, Authorship) .. RevisionAuthorship
|
2020-10-24 14:55:31 -04:00
|
|
|
|
|
|
|
MediaUpload "0..*" -- "1" Note
|
|
|
|
Note "1" - "1..*" Revision
|
|
|
|
Note "0..*" -l- "0..*" Tag
|
|
|
|
Note "0..*" -- "0..*" Group
|
|
|
|
|
|
|
|
User "0..*" -- "0..*" Note
|
|
|
|
(User, Note) . NoteUserPermission
|
|
|
|
(Note, Group) . NoteGroupPermission
|
|
|
|
|
2020-08-12 13:47:22 -04:00
|
|
|
@enduml
|