hhplus-ecommerce
Tables (6)
Balance (잔액)
- 유저ID (user_id2) — BIGINT — Foreign key → Users.유저ID — NOT NULL
- 잔액 (amount) — INT
- 생성일 (created_at)
- 수정일 (updated_at)
Coupons (쿠폰)
- 쿠폰ID (coupon_id) — BIGINT — Primary key — NOT NULL
- 할인율 (discount_rate) — INT
- 사용여부 (coupon_status) — ENUM
- 생성일 (created_at)
- 수정일 (updated_at)
- 유저ID (user_id) — BIGINT — Foreign key → Users.유저ID — NOT NULL
OrderProducts (주문상세)
- 주문상세ID (order_product_id) — BIGINT — Primary key — NOT NULL
- 주문ID (order_id) — BIGINT — Foreign key → Orders.주문ID — NOT NULL
- 상품ID (product_id) — BIGINT — Foreign key → Products.상품ID — NOT NULL
- 수량 (quantity) — INT
- 생성일 (created_at)
- 수정일 (updated_at)
Orders (주문)
- 주문ID (order_id) — BIGINT — Primary key — NOT NULL
- 유저ID (user_id) — BIGINT — Foreign key → Users.유저ID — NOT NULL
- 총금액 (total_price) — INT
- 생성일 (created_at)
- 수정일 (updated_at)
- 쿠폰ID (coupon_id) — BIGINT — Foreign key → Coupons.쿠폰ID — NOT NULL
Products (상품)
- 상품ID (product_id) — BIGINT — Primary key — NOT NULL
- 상품명 (product_name) — VARCHAR(255)
- 가격 (price) — INT
- 재고 (stock_quantity) — INT
- 생성일 (created_at)
- 수정일 (updated_at)
Users (유저)
- 유저ID (user_id) — BIGINT — Primary key — NOT NULL
- 이메일 (email) — VARCHAR(255)
- 비밀번호 (password) — VARCHAR(255) — NOT NULL
- 이름 (user_name) — VARCHAR(255)
- 생성일 (created_at)
- 수정일 (updated_at)