2024-02-08 10:50:19 +01:00
|
|
|
// 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]
|
2024-02-08 11:03:25 +01:00
|
|
|
customer_id string
|
2024-02-08 10:50:19 +01:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2024-02-08 11:03:25 +01:00
|
|
|
Ref: Order.customer_id > Customer.id
|
2024-02-08 10:50:19 +01:00
|
|
|
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
|