SWE_BOOK

Tables (7)

book_images

  • image_id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key — NOT NULL
  • image_url — VARCHAR(500) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • is_cover — BOOLEAN — NOT NULL — 표지 이미지인지에 대한 여부

books

  • book_id — BIGINT — Primary key — NOT NULL
  • title — VARCHAR(150) — NOT NULL
  • author — VARCHAR(100)
  • publisher — VARCHAR(100)
  • edition — VARCHAR(50)
  • isbn — VARCHAR(30)
  • created_at — DATETIME — NOT NULL

categories

  • category_code — CHAR(6) — Primary key — NOT NULL
  • parent_code — CHAR(6) — Foreign key → categories.category_code — 전공 코드 = 부모 코드
  • type — ENUM — NOT NULL
  • name — VARCHAR(50) — NOT NULL

trade_available_time

  • id — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → trade_posts.post_id — NOT NULL
  • start_at — DATETIME — NOT NULL
  • end_at — DATETIME — NOT NULL

trade_posts

  • post_id — BIGINT — Primary key — NOT NULL
  • seller_id — BIGINT — Foreign key — NOT NULL
  • book_id — BIGINT — Foreign key — NOT NULL
  • category_code — Foreign key → categories.category_code — NOT NULL
  • price — INT — NOT NULL
  • description — TEXT
  • status — ENUM — NOT NULL — 'AVAILABLE', 'RESERVED', 'SOLD'
  • place_name — TEXT — NOT NULL — detail_address 삭제
  • latitude — DECIMAL(10,7) — NOT NULL — 위치 위도
  • longitude — DECIMAL(10,7) — NOT NULL — 위치 경도
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • deleted_at — DATETIME
  • radius — INT — NOT NULL — 판매 중심 반경

trade_requests

  • request_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 구매자 id , unique 제약
  • post_id — BIGINT — Foreign key → trade_posts.post_id — NOT NULL — 판매글 id , unique 제약
  • available_time — DATETIME — NOT NULL — 구매 가능한 시간
  • status — ENUM — NOT NULL — 'PENDING' , 'REJECTED' , 'ACCEPTED'

users

  • user_id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • nickname — VARCHAR(50) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • latitude — DECIMAL(10,7) — NOT NULL — 유저 중심 좌표
  • longitude — DECIMAL(10,7) — NOT NULL — 유저 중심 좌표
  • radius — INT — NOT NULL — 유저 중심 반경