선정리는 이게 최선 😅
Table "User" {
"UserId" BIGINT [pk, increment]
"Username" VARCHAR(255) [not null]
"Password" VARCHAR(255) [not null]
"FirstName" VARCHAR(255)
"LastName" VARCHAR(255)
"Email" VARCHAR(255) [unique, not null]
}
Table "Product" {
"ProductId" BIGINT [pk, increment]
"Name" VARCHAR(255) [not null]
"Price" DECIMAL(10,2) [not null]
"Category" VARCHAR(50)
"Description" TEXT
}
Table "Cart" {
"CartId" BIGINT [pk, increment]
"UserId" BIGINT [not null]
}
Table "CartItem" {
"CartItemId" BIGINT [pk, increment]
"CartId" BIGINT [not null]
"ProductId" BIGINT [not null]
"Quantity" INT [not null]
}
Table "Inventory" {
"InventoryId" BIGINT [pk, increment]
"ProductId" BIGINT [not null]
"StockQuantity" INT [not null]
}
Table "Order" {
"OrderId" BIGINT [pk, increment]
"UserId" BIGINT [not null]
"OrderDate" TIMESTAMP [not null]
"OrderStatus" VARCHAR(255) [not null]
}
Table "OrderItem" {
"OrderItemId" BIGINT [pk, increment]
"OrderId" BIGINT [not null]
"ProductId" BIGINT [not null]
"Quantity" INT [not null]
}
Table "Payment" {
"PaymentId" BIGINT [pk, increment]
"OrderId" BIGINT [not null]
"PaymentMethod" VARCHAR(255) [not null]
"Amount" DECIMAL(10,2) [not null]
"PaymentDate" TIMESTAMP [not null]
}
Table "ProductReview" {
"ReviewId" BIGINT [pk, increment]
"ProductId" BIGINT [not null]
"UserId" BIGINT [not null]
"Rating" INT [not null]
"Comment" TEXT
"ReviewDate" TIMESTAMP [not null]
}
Table "Shipping" {
"ShippingId" BIGINT [pk, increment]
"OrderId" BIGINT [not null]
"ShippingAddress" VARCHAR(255) [not null]
"ShippedDate" TIMESTAMP
}
Ref:"User"."UserId" < "Cart"."UserId"
Ref:"Cart"."CartId" < "CartItem"."CartId"
Ref:"Product"."ProductId" < "CartItem"."ProductId"
Ref:"Product"."ProductId" < "Inventory"."ProductId"
Ref:"User"."UserId" < "Order"."UserId"
Ref:"Order"."OrderId" < "OrderItem"."OrderId"
Ref:"Product"."ProductId" < "OrderItem"."ProductId"
Ref:"Order"."OrderId" < "Payment"."OrderId"
Ref:"Product"."ProductId" < "ProductReview"."ProductId"
Ref:"User"."UserId" < "ProductReview"."UserId"
Ref:"Order"."OrderId" < "Shipping"."OrderId"
erd가 곧 개요지만 내일 개요도 올리는걸로..!
막상 짜고나니까
이 숨막히는 양을 보고 경악.. 심지어 기술적으로 다 비슷비슷한거라 노가다의 연속이라 결국 리뉴얼을 하도록했다..! 좀 더 crud스러운건 간소화하고 심도있게 다루고싶다 라는생각으로? ㅎㅎ..