Skip to content

Instantly share code, notes, and snippets.

@stacyhorton
Created July 31, 2018 01:33
Show Gist options
  • Save stacyhorton/d847facb08fa63207b5028fe2814e87e to your computer and use it in GitHub Desktop.
Save stacyhorton/d847facb08fa63207b5028fe2814e87e to your computer and use it in GitHub Desktop.
Some examples of how to use the as-yet undocumented PlantUML ERD functionality.
@startuml
hide circle
hide empty members
' PlantUML ERD examples worked out from:
' https://github.com/plantuml/plantuml/pull/31
together {
' zero or one
foo1 -o| bar1
' exactly one
foo2 --|| bar2
' zero or many
foo3 -o{ bar3
' one or many
foo4 -|{ bar4
' you can combine any of these at both ends
foo5 ||-|{ bar5
}
entity User {
**id** int [PRI]
other_key guid
--
**group_id** int [FK]
--
**email** [UNIQ]
firstname varchar(255)
lastname varchar(255)
created_at datetime
updated_at datetime
...
}
entity Group {
**id** int [PRI]
--
...
}
Group -o{ User
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment