ER Diagram
erDiagram
REVIEW {
int id(pk)
int product_id(fk)
int user_id(fk)
string rating
string headline
text review_text
string review_image1
string review_image2
string review_image3
string review_image4
string review_image5
string review_video
int helpful_count
datetime created_at
datetime updated_at
}
REPORT {
int id(pk)
int user_id(fk)
int review_id(fk)
string reason
text description
datetime created_at
}
HELPFUL_VOTE {
int id(pk)
int user_id(fk)
int review_id(fk)
boolean is_helpful
}
USER {
int id(pk)
string email
string phone
string photo
text address
int gender_id(fk)
int country_id(fk)
date birthday
datetime created_at
datetime updated_at
}
PRODUCT {
int id(pk)
string name
string slug
int vendor_id(fk)
int shop_id(fk)
text description
decimal price
int collection_id(fk)
decimal discount_percent
int category_id(fk)
string video
boolean is_featured
boolean is_active
datetime created_at
datetime updated_at
string brand
string color
string size
string fabric
int popularity
}
USER ||--o{ REVIEW : writes
PRODUCT ||--o{ REVIEW : receives
REPORT ||--o{ REVIEW : reports
HELPFUL_VOTE ||--o{ REVIEW : votes
REPORT ||--|| USER : reported_by
HELPFUL_VOTE ||--|| USER : voted_by
PRODUCT ||--|| VENDOR : belongs_to
PRODUCT ||--|| CATEGORY : belongs_to
PRODUCT ||--o{ SHOP : sold_in
PRODUCT ||--o{ SIGNATURE_COLLECTION : belongs_to