Created
June 8, 2018 06:30
-
-
Save marcorodas/9389c9e9f8a16de642061d3a8013a05d to your computer and use it in GitHub Desktop.
Enhanced Entity–Relationship
This file contains hidden or 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
| @startuml | |
| ' see: http://plantuml.com/classes.html#More | |
| skinparam LineType ortho | |
| skinparam Shadowing false | |
| skinparam Class { | |
| HeaderBackgroundColor #98BFDA | |
| BackgroundColor White | |
| BorderColor #808080 | |
| ArrowColor #8c8c8c | |
| } | |
| !define TABLE(name) class name | |
| !define PK(x) <color:#f0c314><&key></color>**x** | |
| !define FK(x) <color:#dd776c><&key></color>**x** | |
| !define UNIQUE(x) <color:#fe5a63><&underline></color>x | |
| !define VARCHAR(size) {field}VARCHAR(size) | |
| !define CHAR(size) {field}CHAR(size) | |
| !define NOT_NULL(x) <size:9>not null</size> | |
| hide methods | |
| hide stereotypes | |
| hide circle | |
| TABLE(user) { | |
| PK(id) INTEGER | |
| UNIQUE(username) VARCHAR(32) NOT_NULL() | |
| password VARCHAR(64) | |
| } | |
| TABLE(user_profile) { | |
| PK(user_id) INTEGER | |
| age SMALLINT | |
| gender SMALLINT | |
| birthday DATETIME | |
| } | |
| user_profile }-- user | |
| TABLE(session) { | |
| PK(id) INTEGER | |
| FK(user_id) INTEGER NOT_NULL() | |
| UNIQUE(session_id) VARCHAR(64) NOT_NULL() | |
| } | |
| session }-- user | |
| TABLE(group) { | |
| PK(id) INTEGER | |
| name VARCHAR(32) NOT_NULL() | |
| } | |
| TABLE(user_group) { | |
| FK(user_id) INTEGER | |
| FK(group_id) INTEGER | |
| joined_at DATETIME | |
| } | |
| user_group }-- user | |
| user_group }-- group | |
| @enduml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment