Datenbank Design aktualisiert
parent
1b200b2912
commit
73bb2547bd
@ -3,7 +3,8 @@
|
|||||||
> 
|
> 
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
Table categories {
|
Table categories
|
||||||
|
{
|
||||||
categoryID int [pk]
|
categoryID int [pk]
|
||||||
name varchar(255)
|
name varchar(255)
|
||||||
parentCategoryID int
|
parentCategoryID int
|
||||||
@ -11,30 +12,34 @@ Table categories {
|
|||||||
|
|
||||||
Ref: "categories"."parentCategoryID" < "categories"."categoryID"
|
Ref: "categories"."parentCategoryID" < "categories"."categoryID"
|
||||||
|
|
||||||
Table brands {
|
Table brands
|
||||||
|
{
|
||||||
brandID int [pk]
|
brandID int [pk]
|
||||||
name varchar(255)
|
name varchar(255)
|
||||||
}
|
}
|
||||||
|
|
||||||
Table products {
|
Table products
|
||||||
|
{
|
||||||
productID int [pk]
|
productID int [pk]
|
||||||
categoryID int
|
categoryID int
|
||||||
brandID int
|
brandID int
|
||||||
model varchar(255)
|
model varchar(255)
|
||||||
ean varchar(20)
|
|
||||||
description text
|
description text
|
||||||
|
imagePath varchar(255)
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref: "products"."categoryID" < "categories"."categoryID"
|
Ref: "products"."categoryID" < "categories"."categoryID"
|
||||||
Ref: "products"."brandID" < "brands"."brandID"
|
Ref: "products"."brandID" < "brands"."brandID"
|
||||||
|
|
||||||
Table shops {
|
Table shops
|
||||||
|
{
|
||||||
shopID int [pk]
|
shopID int [pk]
|
||||||
name varchar(255)
|
name varchar(255)
|
||||||
website varchar(255)
|
website varchar(255)
|
||||||
}
|
}
|
||||||
|
|
||||||
Table offers {
|
Table offers
|
||||||
|
{
|
||||||
offerID int [pk]
|
offerID int [pk]
|
||||||
productID int
|
productID int
|
||||||
shopID int
|
shopID int
|
||||||
@ -48,14 +53,16 @@ Table offers {
|
|||||||
Ref: "offers"."productID" < "products"."productID"
|
Ref: "offers"."productID" < "products"."productID"
|
||||||
Ref: "offers"."shopID" < "shops"."shopID"
|
Ref: "offers"."shopID" < "shops"."shopID"
|
||||||
|
|
||||||
Table attributes {
|
Table attributes
|
||||||
|
{
|
||||||
attributeID int [pk]
|
attributeID int [pk]
|
||||||
name varchar(255)
|
name varchar(255)
|
||||||
unit varchar(50)
|
unit varchar(50)
|
||||||
dataType varchar(20)
|
dataType varchar(20)
|
||||||
}
|
}
|
||||||
|
|
||||||
Table categoryAttributes {
|
Table categoryAttributes
|
||||||
|
{
|
||||||
categoryID int
|
categoryID int
|
||||||
attributeID int
|
attributeID int
|
||||||
}
|
}
|
||||||
@ -63,7 +70,8 @@ Table categoryAttributes {
|
|||||||
Ref: "categoryAttributes"."categoryID" < "categories"."categoryID"
|
Ref: "categoryAttributes"."categoryID" < "categories"."categoryID"
|
||||||
Ref: "categoryAttributes"."attributeID" < "attributes"."attributeID"
|
Ref: "categoryAttributes"."attributeID" < "attributes"."attributeID"
|
||||||
|
|
||||||
Table productAttributes {
|
Table productAttributes
|
||||||
|
{
|
||||||
productID int
|
productID int
|
||||||
attributeID int
|
attributeID int
|
||||||
valueString varchar(255)
|
valueString varchar(255)
|
||||||
@ -76,21 +84,33 @@ Ref: "productAttributes"."attributeID" < "attributes"."attributeID"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Table users {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Table users
|
||||||
|
{
|
||||||
userID int [pk]
|
userID int [pk]
|
||||||
email varchar(255)
|
email varchar(255)
|
||||||
passwordHash varchar(255)
|
passwordHash varchar(255)
|
||||||
displayName varchar(255)
|
displayName varchar(255)
|
||||||
isActive boolean
|
isActive boolean
|
||||||
createdAt timestamp
|
createdAt timestamp
|
||||||
|
profilePicture varchar(255)
|
||||||
}
|
}
|
||||||
|
|
||||||
Table roles {
|
Table roles
|
||||||
|
{
|
||||||
roleID int [pk]
|
roleID int [pk]
|
||||||
name varchar(50)
|
name varchar(50)
|
||||||
}
|
}
|
||||||
|
|
||||||
Table userRoles {
|
Table userRoles
|
||||||
|
{
|
||||||
userID int
|
userID int
|
||||||
roleID int
|
roleID int
|
||||||
}
|
}
|
||||||
@ -98,7 +118,8 @@ Table userRoles {
|
|||||||
Ref: "userRoles"."userID" < "users"."userID"
|
Ref: "userRoles"."userID" < "users"."userID"
|
||||||
Ref: "userRoles"."roleID" < "roles"."roleID"
|
Ref: "userRoles"."roleID" < "roles"."roleID"
|
||||||
|
|
||||||
Table userFavorites {
|
Table userFavorites
|
||||||
|
{
|
||||||
userID int
|
userID int
|
||||||
productID int
|
productID int
|
||||||
createdAt timestamp
|
createdAt timestamp
|
||||||
@ -107,7 +128,8 @@ Table userFavorites {
|
|||||||
Ref: "userFavorites"."userID" < "users"."userID"
|
Ref: "userFavorites"."userID" < "users"."userID"
|
||||||
Ref: "userFavorites"."productID" < "products"."productID"
|
Ref: "userFavorites"."productID" < "products"."productID"
|
||||||
|
|
||||||
Table priceAlerts {
|
Table priceAlerts
|
||||||
|
{
|
||||||
alertID int [pk]
|
alertID int [pk]
|
||||||
userID int
|
userID int
|
||||||
productID int
|
productID int
|
||||||
@ -119,7 +141,8 @@ Table priceAlerts {
|
|||||||
Ref: "priceAlerts"."userID" < "users"."userID"
|
Ref: "priceAlerts"."userID" < "users"."userID"
|
||||||
Ref: "priceAlerts"."productID" < "products"."productID"
|
Ref: "priceAlerts"."productID" < "products"."productID"
|
||||||
|
|
||||||
Table notifications {
|
Table notifications
|
||||||
|
{
|
||||||
notificationID int [pk]
|
notificationID int [pk]
|
||||||
userID int
|
userID int
|
||||||
title varchar(255)
|
title varchar(255)
|
||||||
@ -130,7 +153,8 @@ Table notifications {
|
|||||||
|
|
||||||
Ref: "notifications"."userID" < "users"."userID"
|
Ref: "notifications"."userID" < "users"."userID"
|
||||||
|
|
||||||
Table reviews {
|
Table reviews
|
||||||
|
{
|
||||||
reviewID int [pk]
|
reviewID int [pk]
|
||||||
userID int
|
userID int
|
||||||
productID int
|
productID int
|
||||||
@ -142,11 +166,13 @@ Table reviews {
|
|||||||
Ref: "reviews"."userID" < "users"."userID"
|
Ref: "reviews"."userID" < "users"."userID"
|
||||||
Ref: "reviews"."productID" < "products"."productID"
|
Ref: "reviews"."productID" < "products"."productID"
|
||||||
|
|
||||||
Table userSessions {
|
Table userSessions
|
||||||
|
{
|
||||||
sessionID varchar(128) [pk]
|
sessionID varchar(128) [pk]
|
||||||
userID int
|
userID int
|
||||||
expiresAt timestamp
|
expiresAt timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref: "userSessions"."userID" < "users"."userID"
|
Ref: "userSessions"."userID" < "users"."userID"
|
||||||
|
|
||||||
```
|
```
|
||||||
Loading…
Reference in New Issue
Block a user