-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: Added database diagram to documentation
- Loading branch information
Showing
4 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
@startuml | ||
!include dbdiagramtheme.puml | ||
|
||
table( projects ) #header:07198C { | ||
primary_key( id, integer ) | ||
column( name, "character varying", true ) | ||
column( description, "character varying" ) | ||
column( color, "character varying", true ) | ||
column( createdAt, timestamp, true ) | ||
column( updatedAt, timestamp, true ) | ||
} | ||
|
||
table( users ) #header:F39C1B { | ||
primary_key( id, "character varying" ) | ||
column( username, "character varying" ) | ||
column( email, "character varying", true ) | ||
column( createdAt, timestamp, true ) | ||
column( updatedAt, timestamp, true ) | ||
} | ||
|
||
table( invitations ) #header:F39C1B { | ||
primary_key( id, integer ) | ||
foreign_key( projectId, integer ) | ||
foreign_key( ownerId, "character varying" ) | ||
foreign_key( guestId, "character varying" ) | ||
column( role, "character varying", true ) | ||
column( createdAt, timestamp ) | ||
column( sourceLanguagesIds, "character varying" ) | ||
column( targetLanguagesIds, "character varying" ) | ||
} | ||
|
||
table( users_projects ) #header:F39C1B { | ||
primary_key( projectId, integer ) | ||
primary_key( userId, "character varying" ) | ||
column( role, "character varying", true ) | ||
column( createdAt, timestamp ) | ||
column( sourceLanguagesIds, "character varying" ) | ||
column( targetLanguagesIds, "character varying" ) | ||
} | ||
|
||
table( groups ) { | ||
primary_key( id, integer ) | ||
foreign_key( projectId, integer, false ) | ||
column( name, "character varying", true ) | ||
column( createdAt, timestamp, true ) | ||
column( updatedAt, timestamp, true ) | ||
} | ||
|
||
table( project_languages ) { | ||
primary_key( id, integer ) | ||
foreign_key( projectId, integer ) | ||
column( name, "character varying", true ) | ||
column( createdAt, timestamp, true ) | ||
column( updatedAt, timestamp, true ) | ||
column( isRtl, boolean, true ) | ||
} | ||
|
||
table( translation_keys ) #header:C0392A { | ||
primary_key( id, integer ) | ||
foreign_key( projectId, integer ) | ||
foreign_key( groupId, integer, false ) | ||
column( name, "character varying", true ) | ||
column( isPlural, boolean, true ) | ||
column( createdAt, timestamp, true ) | ||
column( updatedAt, timestamp, true ) | ||
} | ||
|
||
table( translation_values ) #header:C0392A { | ||
primary_key( id, integer ) | ||
column( name, "character varying", true ) | ||
column( quantityString, "character varying", true ) | ||
column( createdAt, timestamp, true ) | ||
column( updatedAt, timestamp, true ) | ||
foreign_key( keyId, integer ) | ||
foreign_key( languageId, integer ) | ||
column( status, "character varying", true ) | ||
} | ||
|
||
invitations::ownerId }|-- users::id | ||
invitations::guestId }|-- users::id | ||
invitations::projectId }|-- projects::id | ||
users_projects::userId }|-- users::id | ||
users_projects::projectId }|-- projects::id | ||
groups::projectId }|-- projects::id | ||
translation_keys::groupId }|-- groups::id | ||
translation_keys::projectId }|-- projects::id | ||
project_languages::projectId }|-- projects::id | ||
translation_values::keyId }|-- translation_keys::id | ||
translation_values::languageId }|-- project_languages::id | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@startuml | ||
left to right direction | ||
skinparam roundcorner 10 | ||
skinparam shadowing false | ||
skinparam handwritten false | ||
skinparam BackgroundColor #44444D | ||
skinparam class { | ||
FontColor white | ||
AttributeFontColor white | ||
BackgroundColor #38383F | ||
ArrowColor white | ||
BorderColor #38383F | ||
HeaderBackgroundColor #232323 | ||
HeaderFontStyle bold | ||
} | ||
|
||
!define table(x) entity x << (T, white) >> | ||
|
||
!function primary_key($name, $type, $nonnull=true) | ||
!$nn = "" | ||
!if ($nonnull == true) | ||
!$nn = "<<NN>>" | ||
!endif | ||
!return "<b><color:#b8861b><&key></color> " + $name + ": " + $type + " <<PK>> " + $nn + "</b>" | ||
!endfunction | ||
!function foreign_key($name, $type, $nonnull=true) | ||
!$nn = "" | ||
!if ($nonnull == true) | ||
!$nn = "<<NN>>" | ||
!endif | ||
!return "<color:#aaaaaa><&key></color> " + $name + ": " + $type + " <<FK>> " + $nn | ||
!endfunction | ||
!function column($name, $type, $nonnull=false) | ||
!$nn = "" | ||
!if ($nonnull == true) | ||
!$nn = "<<NN>>" | ||
!endif | ||
!return "<color:#efefef><&media-record></color> " + $name + ": " + $type + " " + $nn | ||
!endfunction | ||
|
||
@enduml |