diff --git a/docs/content/dev/db-schema.plantuml b/docs/content/dev/db-schema.plantuml index 789eac254..cb979df37 100644 --- a/docs/content/dev/db-schema.plantuml +++ b/docs/content/dev/db-schema.plantuml @@ -2,18 +2,18 @@ hide circle skinparam nodesep 60 -entity "Note" { +entity "note" { *id : uuid <> -- *shortid : text alias : text *viewcount : number - *ownerId : uuid <> + *ownerId : uuid <> description: text title: text } -entity "User" { +entity "user" { *id : uuid <> -- *userName : text @@ -24,17 +24,17 @@ entity "User" { email : text } -entity "AuthToken" as authToken{ +entity "auth_token"{ *id : number <> -- *userId : uuid *accessToken : text } -entity "Identity" { +entity "identity" { *id : number -- - *userId : uuid <> + *userId : uuid <> ' Identifies the external login provider and is set in the config *providerName : text *syncSource : boolean @@ -48,7 +48,7 @@ entity "Identity" { passwordHash : text } -entity "Session" { +entity "session" { *id : text -- *expiredAt : number @@ -56,47 +56,47 @@ entity "Session" { } -entity "Revision" { +entity "revision" { *id : number <> -- - *noteId : uuid <> + *noteId : uuid <> *content : text *patch : text *createdAt : date *length : number } -entity "Authorship" { +entity "authorship" { *id : uuid <> -- - *userId : uuid > + *userId : uuid > *startPos : number *endPos : number *createdAt : date *updatedAt : date } -entity "RevisionAuthorship" { - *revisionId : number <> - *authorshipId : uuid <> +entity "revision_authorship" { + *revisionId : number <> + *authorshipId : uuid <> } -entity "AuthorColors" { - *noteId : uuid <> - *userId : uuid <> +entity "author_colors" { + *noteId : uuid <> + *userId : uuid <> -- *color : text } -entity "NoteUserPermission" { - *userId : uuid <> - *noteId : uuid <> +entity "note_user_permission" { + *userId : uuid <> + *noteId : uuid <> -- *canEdit : boolean } -entity "Group" { +entity "group" { *id : number <> -- *name : text <> @@ -107,48 +107,48 @@ entity "Group" { *special : boolean } -entity "NoteGroupPermission" { - *groupId : number <> - *noteId : uuid <> +entity "note_group_permission" { + *groupId : number <> + *noteId : uuid <> -- *canEdit : boolean } -entity "Tag" { +entity "tag" { *id: number <> *name: text } -entity "MediaUpload" { +entity "media_upload" { *id : text <> -- - *noteId : uuid <> - *userId : uuid <> + *noteId : uuid <> + *userId : uuid <> *backendType: text backendData: text *createdAt : date } -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 "1" -- "0..*" note: owner +user "1" -u- "1..*" identity +user "1" - "1..*" auth_token +user "1" -l- "1..*" session +user "1" - "0..*" media_upload +user "0..*" -- "0..*" note +user "1" - "0..*" authorship -(User, Note) . AuthorColors +(user, note) . author_colors -Revision "0..*" - "0..*" Authorship -(Revision, Authorship) .. RevisionAuthorship +revision "0..*" - "0..*" authorship +(revision, authorship) .. revision_authorship -MediaUpload "0..*" -- "1" Note -Note "1" - "1..*" Revision -Note "0..*" -l- "0..*" Tag -Note "0..*" -- "0..*" Group +media_upload "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 +user "0..*" -- "0..*" note +(user, note) . note_user_permission +(note, group) . note_group_permission @enduml diff --git a/src/notes/note.entity.ts b/src/notes/note.entity.ts index 5cffcff4b..27424dd95 100644 --- a/src/notes/note.entity.ts +++ b/src/notes/note.entity.ts @@ -21,7 +21,7 @@ import { User } from '../users/user.entity'; import { AuthorColor } from './author-color.entity'; import { Tag } from './tag.entity'; -@Entity('Notes') +@Entity() export class Note { @PrimaryGeneratedColumn('uuid') id: string;