asdsad

Tables (7)

cart

  • cart_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

cart_item

  • cart_item_id — BIGINT — Primary key — NOT NULL
  • cart_id (cart_id2) — BIGINT — Foreign key → cart.cart_id — NOT NULL
  • item_id (item_id2) — BIGINT — Foreign key → item.item_id — NOT NULL
  • quantity — INT — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

category

  • category_id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(60) — NOT NULL
  • parent_id — BIGINT
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

item

  • item_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • category_id (category_id2) — BIGINT — Foreign key → category.category_id — NOT NULL
  • name — VARCHAR(120) — NOT NULL
  • origin — VARCHAR(50)
  • delivery_type — VARCHAR(30)
  • packaging_type — VARCHAR(50)
  • sales_unit — VARCHAR(50)
  • weight — INT
  • price — INT — NOT NULL
  • stock_quantity — INT — NOT NULL
  • item_status — ENUM('ACTIVE','SOLDOUT','HIDDEN') — NOT NULL
  • detail_image_url — VARCHAR(255)
  • thumbnail_url — VARCHAR(255)
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

order_item

  • order_item_id — BIGINT — Primary key — NOT NULL
  • order_id (order_id2) — BIGINT — Foreign key → orders.order_id — NOT NULL
  • item_id (item_id2) — BIGINT — Foreign key → item.item_id — NOT NULL
  • seller_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • quantity — INT — NOT NULL
  • purchase_price — INT — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

orders

  • order_id — BIGINT — Primary key — NOT NULL
  • user_id (user_id2) — BIGINT — Foreign key → users.user_id — NOT NULL
  • order_number — VARCHAR(40) — NOT NULL
  • order_status — ENUM('PENDING','DELIVERING','DELIVERED') — NOT NULL
  • total_price — INT — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • delivery_request — VARCHAR(200)
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL

users

  • user_id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • phone — VARCHAR(20)
  • address — VARCHAR(255)
  • role — ENUM('SELLER', 'USER') — NOT NULL
  • created_at — TIMESTAMP — NOT NULL
  • updated_at — TIMESTAMP — NOT NULL