E-commerce

Tables (9)

coupon (쿠폰 테이블)

  • id (Key) — Primary key — NOT NULL
  • name (Field)
  • discount_amount (Field2)
  • expires_at (Field3)
  • total_quantity (Field4)
  • created_at (Field5)
  • updated_at (Field6)

order_items (주문 상품 테이블)

  • id (Key) — Primary key — NOT NULL
  • order_id (Key2) — Foreign key → orders.id — NOT NULL
  • product_id (Key3) — Foreign key → products.id — NOT NULL
  • id (Key32) — Foreign key → orders.user_coupon_id — NOT NULL
  • quantity (Field)
  • price (Field2)
  • created_at (Field3)
  • updated_at (Field4)

orders (주문 테이블)

  • id (Key) — Primary key — NOT NULL
  • user_id (Key2) — bigint — Foreign key → users.id — NOT NULL
  • user_coupon_id (Key3) — Foreign key → user_coupon.id — NOT NULL
  • status (Field2)
  • total_amount (Field3)
  • created_at (Field4)
  • updated_at (Field)

payment (결제 테이블)

  • id (Key) — Primary key — NOT NULL
  • order_id (Key2) — Foreign key → orders.id — NOT NULL
  • status (Field)
  • created_at (Field2)

products (상품 테이블)

  • id (Key) — Primary key — NOT NULL
  • name (Field)
  • price (Field2)

stocks (재고 테이블)

  • id (Key) — Primary key — NOT NULL
  • product_id (Key2) — Foreign key → products.id — NOT NULL
  • total_quantity (Field)
  • updated_at (Field3)

user_coupon (회원-쿠폰 테이블)

  • id (Key) — Primary key — NOT NULL
  • user_id (Key2) — bigint — Foreign key → users.id — NOT NULL
  • coupon_id (Key3) — Foreign key → coupon.id — NOT NULL
  • status (Field2)
  • used_at (Field3)
  • expired_at (Field4)
  • created_at (Field5)
  • updated_at (Field6)

user_point (회원-포인트 테이블)

  • id (Key) — Primary key — NOT NULL
  • user_id (Key2) — bigint — Foreign key → users.id — NOT NULL
  • point (Field)
  • created_at (Field3)
  • updated_at (Field4)

users (회원 테이블)

  • id (Key) — bigint — Primary key — NOT NULL
  • name (Field)