Skip to content

Instantly share code, notes, and snippets.

@appkr
Last active Feb 16, 2021
Embed
What would you like to do?
ERD in plantuml

entity entity
1 -
0 or 1 -o|
one and only 1 -||
many -{
0 or many -o{
1 or many -|{
@startuml
entity member {
*member_id: bigint(20)
name: varchar(40)
city: varchar(40)
street: varchar(100)
zipcode: varchar(5)
}
'order 는 예약어
entity orders {
*order_id: bigint(20)
member_id: bigint(20)
placed_at: timestamp(3)
status: tinyint(4)
}
entity order_item {
*order_item_id: bigint(20)
order_id: bigint(20)
item_id: bigint(20)
sub_total: decimal(10, 2)
quantity: int(10)
}
entity item {
*item_id: bitint(20)
name: varchar(100)
price: decimal(9, 2)
stock: unsigned int(10)
}
entity category {
*category_id: bigint(20)
parent_id: bigint(20)
name: varchar(40)
}
entity category_item {
*category_id: bigint(20)
item_id: bigint(20)
}
entity delivery {
*delivery_id: bigint(20)
city: varchar(40)
street: varchar(100)
zipcode: varchar(5)
status: tinyint(4)
}
member ||--o{ orders
orders ||-o{ order_item
order_item }o-|| item
orders ||--|| delivery
category ||--o{ category_item
category_item }o--|| item
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment