79 lines
1.6 KiB
Text
79 lines
1.6 KiB
Text
// https://dbdiagram.io/d/
|
|
// Kraut&Rübel ERD
|
|
|
|
Table Customer {
|
|
id string [primary key]
|
|
first_name string
|
|
last_name string
|
|
street string
|
|
birth_date timestamp
|
|
house_number string
|
|
postal_code integer
|
|
email string
|
|
phone integer
|
|
city string
|
|
}
|
|
|
|
Table Order {
|
|
id string [primary key]
|
|
customer_id string
|
|
invoice_amount integer
|
|
order_date timestamp
|
|
}
|
|
|
|
Table Ingredient {
|
|
id string [primary key]
|
|
designation string
|
|
stock integer
|
|
net_price integer
|
|
unit string
|
|
carbonhydrates integer
|
|
calories integer
|
|
protein integer
|
|
}
|
|
|
|
Table Supplier {
|
|
id string [primary key]
|
|
city string
|
|
street string
|
|
email string
|
|
phone string
|
|
supplier_name string
|
|
house_number string
|
|
postal_code integer
|
|
}
|
|
|
|
Table Recipe {
|
|
id string [primary key]
|
|
preperation_time integer
|
|
name string
|
|
description string
|
|
instructions string
|
|
}
|
|
|
|
Table RecipeContainsIngredients {
|
|
recipe string [primary key]
|
|
ingredient string [primary key]
|
|
amount integer
|
|
}
|
|
|
|
Table SupplierContainsIngredients {
|
|
supplier string [primary key]
|
|
ingredient string [primary key]
|
|
delivery_cost integer
|
|
delivery_time integer
|
|
}
|
|
|
|
Table OrderContainsIngredients {
|
|
order string [primary key]
|
|
ingredient string [primary key]
|
|
quantity integer
|
|
}
|
|
|
|
Ref: Order.customer_id > Customer.id
|
|
Ref: SupplierContainsIngredients.supplier > Supplier.id
|
|
Ref: SupplierContainsIngredients.ingredient > Ingredient.id
|
|
Ref: OrderContainsIngredients.order > Order.id
|
|
Ref: OrderContainsIngredients.ingredient > Ingredient.id
|
|
Ref: RecipeContainsIngredients.recipe > Recipe.id
|
|
Ref: RecipeContainsIngredients.ingredient > Ingredient.id
|