MyModakbul

Tables (8)

booking

  • id — BIGINT — Primary key — NOT NULL
  • member_id — BIGINT — Foreign key → member.id — NOT NULL
  • campsite_id — BIGINT — Foreign key → campsite.id — NOT NULL
  • check_in_date — DATE — NOT NULL
  • check_out_date — DATE — NOT NULL
  • total_price — INT — NOT NULL — 총 결제 금액
  • booking_status — VARCHAR(50) — NOT NULL — PENDING_PAYMENT(결제대기), CONFIRMED(예약확정), CANCELLED(취소)
  • created_at — TIMESTAMP

campground

  • id — BIGINT — Primary key — NOT NULL
  • host_id — BIGINT — Foreign key → member.id — NOT NULL
  • campground_name — VARCHAR(255) — NOT NULL
  • address — VARCHAR(255) — NOT NULL
  • detail_address — VARCHAR(255)
  • phone — VARCHAR(255)
  • created_at — TIMESTAMP

campsite

  • id — BIGINT — Primary key — NOT NULL
  • campground_id — BIGINT — Foreign key → campground.id — NOT NULL
  • campsite_name — VARCHAR(255) — NOT NULL
  • weekday_price — INT — NOT NULL — 평일 기본가
  • weekend_price — INT — NOT NULL — 주말 기본가
  • max_capacity — INT — NOT NULL — 최대 수용 인원

campsite_special_price

  • id — BIGINT — Primary key — NOT NULL
  • campsite_id — BIGINT — Foreign key → campsite.id — NOT NULL
  • target_date — DATE — NOT NULL — 가격 변동 적용 일자
  • price — INT — NOT NULL — 변경될 특수 가격

host

  • member_id — BIGINT — Foreign key → member.id — NOT NULL
  • business_registration_number — VARCHAR(50) — NOT NULL — 사업자 등록 번호
  • bank_name — VARCHAR(50) — NOT NULL — 정산 은행
  • account_number — VARCHAR(100) — NOT NULL — 계좌 번호
  • created_at — TIMESTAMP

member

  • id — BIGINT — Primary key — NOT NULL
  • user_id — VARCHAR(255) — NOT NULL — 로그인 아이디
  • password — VARCHAR(255) — NOT NULL
  • user_name — VARCHAR(255) — NOT NULL
  • phone — VARCHAR(255) — NOT NULL
  • mail — VARCHAR(255) — NOT NULL
  • role — VARCHAR(50) — NOT NULL — USER, HOST, ADMIN
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

payment

  • id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → booking.id — NOT NULL
  • member_id — BIGINT — Foreign key → member.id — NOT NULL
  • amount — INT — NOT NULL
  • payment_method — VARCHAR(50)
  • payment_status — VARCHAR(50) — NOT NULL — READY, SUCCESS, FAILED, CANCELLED
  • pg_payment_key — VARCHAR(255) — PG사 승인 키
  • idempotency_key — VARCHAR(255) — NOT NULL — 중복 결제 방지용 멱등성 키
  • approve_date — TIMESTAMP
  • created_at — TIMESTAMP

review

  • id — BIGINT — Primary key — NOT NULL
  • booking_id — BIGINT — Foreign key → booking.id — NOT NULL
  • member_id — BIGINT — Foreign key → member.id — NOT NULL
  • message — VARCHAR(255)
  • rating — INT
  • created_at — TIMESTAMP