erd

Tables (11)

ACTIVITY_LOGS

  • log_id — bigint
  • user_id — bigint
  • action_type — varchar(255)
  • description — text
  • created_at — timestamp
  • ip_address — varchar(255)

CART_ITEMS

  • cart_item_id — bigint
  • user_id — bigint
  • product_id — bigint
  • quantity — int
  • added_at — timestamp

COUPONS

  • coupon_id — bigint
  • code — varchar(255)
  • type — varchar(255)
  • value — decimal
  • total_quantity — int
  • used_quantity — int
  • valid_from — timestamp
  • valid_until — timestamp
  • is_active — boolean

ORDERS

  • order_id — bigint
  • user_id — bigint
  • total_amount — decimal
  • status — varchar(255)
  • order_date — timestamp
  • coupon_id — bigint
  • shipping_address — text

ORDER_ITEMS

  • order_item_id — bigint
  • order_id — bigint
  • product_id — bigint
  • quantity — int
  • unit_price — decimal
  • subtotal — decimal

PAYMENTS

  • payment_id — bigint
  • order_id — bigint
  • amount — decimal
  • payment_method — varchar(255)
  • status — varchar(255)
  • payment_date — timestamp

PRODUCTS

  • product_id — bigint
  • name — varchar(255)
  • description — text
  • price — decimal
  • category — varchar(255)
  • created_at — timestamp
  • updated_at — timestamp
  • is_active — boolean

PRODUCT_ANALYTICS

  • analytics_id — bigint
  • product_id — bigint
  • view_count — int
  • purchase_count — int
  • conversion_rate — decimal
  • recorded_at — timestamp

PRODUCT_INVENTORY

  • inventory_id — bigint
  • product_id — bigint
  • quantity — int
  • last_updated — timestamp

USERS

  • user_id — bigint
  • email — varchar(255)
  • password — varchar(255)
  • name — varchar(255)
  • phone — varchar(255)
  • created_at — timestamp
  • updated_at — timestamp
  • is_active — boolean

USER_COUPONS

  • user_coupon_id — bigint
  • user_id — bigint
  • coupon_id — bigint
  • is_used — boolean
  • used_at — timestamp
  • issued_at — timestamp