Skip to content

ER Diagram

Entity-Relationship Diagram of Shop Application


Below is the Entity-Relationship Diagram for the Shop, ShopFollowers, and ShopReviewsRatings models.

erDiagram
    SHOP {
        int id PK
        int vendor_id FK
        string shop_name
        string phone_number
        text description
        string shop_location
        string warehouse_location
        string shop_image
        string shop_cover_image
        datetime created_at
        datetime updated_at
    }
    SHOP_FOLLOWERS {
        int id PK
        int shop_id FK
        int user_id FK
        boolean has_followed
        datetime created_at
        datetime updated_at
    }
    SHOP_REVIEWS_RATINGS {
        int id PK
        int shop_id FK
        int user_id FK
        string rating
        text review_text
        string review_image1
        string review_image2
        string review_image3
        string review_image4
        string review_image5
        string review_video
        datetime created_at
        datetime updated_at
    }
    VENDOR {
        int id PK
        string company_name
        int user_id FK
        string telephone
        date company_created_at
        string company_address
        datetime created_at
        datetime updated_at
    }
    USER {
        int id PK
        string email
        string phone
        boolean has_initial_profile
        string photo
        text address
        int gender_id FK
        int country_id FK
        date birthday
        datetime created_at
        datetime updated_at
    }

    VENDOR ||--o{ SHOP : "owns"
    SHOP ||--o{ SHOP_FOLLOWERS : "has"
    SHOP ||--o{ SHOP_REVIEWS_RATINGS : "receives"
    USER ||--o{ SHOP_FOLLOWERS : "follows"
    USER ||--o{ SHOP_REVIEWS_RATINGS : "reviews"