update erm

This commit is contained in:
hilfe 2024-02-08 20:16:21 +01:00
parent 0bee5353ed
commit 17eb1eb1a2

View file

@ -1,23 +1,20 @@
// https://dbdiagram.io/d/
// Kraut&Rübel ERD
// Kraut&Rüben ERD
Table Customer {
id string [primary key]
address_id string
first_name string
last_name string
street string
birth_date timestamp
house_number string
postal_code integer
email string
phone integer
city string
phone string
}
Table Order {
id string [primary key]
customer_id string
invoice_amount integer
invoice_amount float
order_date timestamp
}
@ -25,22 +22,19 @@ Table Ingredient {
id string [primary key]
designation string
stock integer
net_price integer
net_price float
unit string
carbonhydrates integer
carbonhydrates float
calories integer
protein integer
protein float
}
Table Supplier {
id string [primary key]
city string
street string
address_id string
email string
phone string
supplier_name string
house_number string
postal_code integer
}
Table Recipe {
@ -51,6 +45,14 @@ Table Recipe {
instructions string
}
Table Address {
id string [primary key]
city string
street string
house_number string
postal_code integer
}
Table RecipeContainsIngredients {
recipe string [primary key]
ingredient string [primary key]
@ -60,7 +62,7 @@ Table RecipeContainsIngredients {
Table SupplierContainsIngredients {
supplier string [primary key]
ingredient string [primary key]
delivery_cost integer
delivery_cost float
delivery_time integer
}
@ -71,9 +73,11 @@ Table OrderContainsIngredients {
}
Ref: Order.customer_id > Customer.id
Ref: Address.id - Customer.address_id
Ref: Address.id - Supplier.address_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
Ref: RecipeContainsIngredients.ingredient > Ingredient.id