lf5/erd.dbml

83 lines
1.6 KiB
Text
Raw Normal View History

2024-02-08 10:50:19 +01:00
// https://dbdiagram.io/d/
2024-02-08 20:16:21 +01:00
// Kraut&Rüben ERD
2024-02-08 10:50:19 +01:00
Table Customer {
id string [primary key]
2024-02-08 20:16:21 +01:00
address_id string
2024-02-08 10:50:19 +01:00
first_name string
last_name string
birth_date timestamp
email string
2024-02-08 20:16:21 +01:00
phone string
2024-02-08 10:50:19 +01:00
}
Table Order {
id string [primary key]
2024-02-08 11:03:25 +01:00
customer_id string
2024-02-08 20:16:21 +01:00
invoice_amount float
2024-02-08 10:50:19 +01:00
order_date timestamp
}
Table Ingredient {
id string [primary key]
designation string
stock integer
2024-02-08 20:16:21 +01:00
net_price float
2024-02-08 10:50:19 +01:00
unit string
2024-02-08 20:16:21 +01:00
carbonhydrates float
2024-02-08 10:50:19 +01:00
calories integer
2024-02-08 20:16:21 +01:00
protein float
2024-02-08 10:50:19 +01:00
}
Table Supplier {
id string [primary key]
2024-02-08 20:16:21 +01:00
address_id string
2024-02-08 10:50:19 +01:00
email string
phone string
supplier_name string
}
Table Recipe {
id string [primary key]
preperation_time integer
name string
description string
instructions string
}
2024-02-08 20:16:21 +01:00
Table Address {
id string [primary key]
city string
street string
house_number string
postal_code integer
}
2024-02-08 10:50:19 +01:00
Table RecipeContainsIngredients {
recipe string [primary key]
ingredient string [primary key]
amount integer
}
Table SupplierContainsIngredients {
supplier string [primary key]
ingredient string [primary key]
2024-02-08 20:16:21 +01:00
delivery_cost float
2024-02-08 10:50:19 +01:00
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 20:16:21 +01:00
Ref: Address.id - Customer.address_id
Ref: Address.id - Supplier.address_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
2024-02-08 20:16:21 +01:00
Ref: RecipeContainsIngredients.ingredient > Ingredient.id