콘서트 예매 시스템
테이블 (8)
결제 (payment)
- id (PK) — bigint — 기본 키 — NOT NULL
- reservation_id (예약 PK) — bigint — 외래 키 → 예약.id — NOT NULL
- payment_price (결제금액) — int
- status (결제 상태) — smallint — 0: 결제대기, 1: 결제완료, 2: 결제취소, 3: 환불
- create_date (생성날짜) — datetime
- update_date (수정날짜) — datetime
예약 (reservation)
- id (PK) — bigint — 기본 키 — NOT NULL
- user_id (유저 PK) — bigint — 외래 키 → 유저.id — NOT NULL
- concert_detail_id (콘서트 상세 PK) — bigint — 외래 키 → 좌석.concert_detail_id — NOT NULL
- seat_id (좌석 PK) — bigint — 외래 키 → 좌석.id — NOT NULL
- status (예약 상태) — smallint — 0: 진행중, 1: 완료, 2: 취소
- create_date (생성날짜) — datetime
- update_date (수정날짜) — datetime
유저 (users)
- id (PK) — bigint — 기본 키 — NOT NULL
- create_date (생성날짜) — datetime
- update_date (업데이트날짜) — datetime
- point (잔액) — int
유저 잔액 히스토리 (user_point_history)
- id (PK) — bigint — 기본 키 — NOT NULL
- user_id (유저 PK) — bigint — 외래 키 → 유저.id — NOT NULL
- price (금액) — int
- type (히스토리 타입) — smallint — 0: 충전, 1: 사용
- create_date (생성날짜) — datetime
유저토큰 (user_token)
- Key — 기본 키 — NOT NULL
- user_id (유저 PK) — bigint — 외래 키 → 유저.id — NOT NULL
- token (토큰값) — varchar(255)
- status (토큰 상태값) — smallint — 0: 활성, 1: 대기, 2: 만료
- create_date (생성날짜) — datetime — 요청날짜로 사용
- active_date (활성화날짜) — datetime — 활성화 시간으로 sorting을 해야하지 않을까?
좌석 (seat)
- id (PK) — bigint — 기본 키 — NOT NULL
- concert_detail_id (콘서트 상세 PK) — bigint — 외래 키 → 콘서트 상세.id — NOT NULL
- seat_number (좌석번호) — int
- price (좌석 가격) — int
- status (좌석상태) — smallint — 0: 미배정, 1: 임시배정, 2: 배정완료
- create_date (생성날짜) — datetime
- update_date (수정날짜) — datetime
콘서트 (concert)
- id (PK) — bigint — 기본 키 — NOT NULL
- name (콘서트 이름) — varchar(30)
- create_date (생성날짜) — datetime
- update_date (수정날짜) — datetime
콘서트 상세 (concert_detail)
- id (PK) — bigint — 기본 키 — NOT NULL
- concert_id (콘서트 PK) — bigint — 외래 키 → 콘서트.id — NOT NULL
- concert_date (콘서트 일시) — datetime
- available_reservation_date (예약 가능한 일시) — datetime
- create_date (생성날짜) — datetime
- update_date (수정날짜) — datetime