이커머스
테이블 (10)
결제 (Payment)
- 결제 ID (id) — not null — 기본 키 — NOT NULL
- 주문 ID (orders_id) — not null — 외래 키 → 주문.주문 ID — NOT NULL
- 결제 금액 (payment_price) — not null
- 결제 상태 (payment_status) — not null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
사용자 (User)
- 사용자 ID (id) — not null — 기본 키 — NOT NULL
- 이름 (name) — not null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
사용자 쿠폰 (User_Coupon)
- 사용자 쿠폰 ID (id) — not null — 기본 키 — NOT NULL
- 사용자 ID (user_id) — not null — 외래 키 → 사용자.사용자 ID — NOT NULL
- 쿠폰 ID (coupon_id) — not null — 외래 키 → 쿠폰.쿠폰 ID — NOT NULL
- 상태 (status) — not null
- 만료일자 (expire_dt) — null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
상품 (Product)
- 상품 ID (id) — not null — 기본 키 — NOT NULL
- 상품명 (product_name) — not null
- 상품 가격 (product_price) — not null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
재고 (Stock)
- 재고 ID (id) — not null — 기본 키 — NOT NULL
- 상품 ID (product_id) — not null — 외래 키 → 상품.상품 ID — NOT NULL
- 재고 수량 (stock) — not null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
주문 (Orders)
- 주문 ID (id) — not null — 기본 키 — NOT NULL
- 사용자 ID (user_id) — not null — 외래 키 → 사용자.사용자 ID — NOT NULL
- 사용자 쿠폰 ID (user_coupon_id) — null — 외래 키 → 사용자 쿠폰.사용자 쿠폰 ID — NOT NULL
- 주문 원가 (base_price) — not null
- 쿠폰 할인가 (discount_amount) — not null
- 최종 가격 (final_price) — not null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
주문상품 (Order_Product)
- 주문상품 ID (id) — not null — 기본 키 — NOT NULL
- 주문 ID (order_id) — not null — 외래 키 → 주문.주문 ID — NOT NULL
- 상품 ID (product_id) — not null — 외래 키 → 상품.상품 ID — NOT NULL
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
쿠폰 (Coupon)
- 쿠폰 ID (id) — not null — 기본 키 — NOT NULL
- 쿠폰명 (coupon_name) — not null
- 쿠폰 타입 (coupon_type) — not null
- 정액 할인 금액 (discouont_amount) — null
- 정률 할인율 (discount_rate) — null
- 사용 시작일 (usable_start_dt) — not null
- 사용 종료일 (usable_end_dt) — not null
- 재고 수량 (coupon_stock) — null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
포인트 (Point)
- 포인트 ID (id) — not null — 기본 키 — NOT NULL
- 사용자 ID (user_id) — not null — 외래 키 → 사용자.사용자 ID — NOT NULL
- 잔액 (balance) — not null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
포인트 이력 (PointHistory)
- 포인트 이력 ID (id) — not null — 기본 키 — NOT NULL
- 포인트 ID (point_id) — not null — 외래 키 → 포인트.포인트 ID — NOT NULL
- 거래 타입 (transaction_type) — not null
- 생성일자 (created_at) — not null
- 수정일자 (updated_at) — not null
- 변동 금액 (amount) — not null