CGV clone
Tables (13)
Movie (영화)
- movie_id (id) — bigint — Primary key — NOT NULL
- title (영화 제목) — varchar
- release_date (개봉일) — date
- runtime (러닝타임) — int
- genre (장르) — varchar
- prologue (프롤로그) — text
- age_rating (연령 제한) — Enum
- image_url (이미지) — varchar
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
MovieFavorite (영화찜)
- movie_fav_id (id) — bigint — Primary key — NOT NULL
- movie_id — bigint — Foreign key → Movie.movie_id — NOT NULL
- user_id — bigint — Foreign key → User.user_id — NOT NULL
- created_at (생성시간) — date
- updated_at (수정시간) — date
Order_Item (주문 상품)
- orderitem_id (id) — bigint — Primary key — NOT NULL
- order_id — bigint — Foreign key → Orders.order_id — NOT NULL
- product_id — bigint — Foreign key → Product.product_id — NOT NULL
- quantity (주문 개수) — int
- price (가격) — int
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
Orders (주문)
- order_id (id) — bigint — Primary key — NOT NULL
- user_id — bigint — Foreign key → User.user_id — NOT NULL
- theater_id — bigint — Foreign key → Theater.theater_id — NOT NULL
- total_price (총 가격) — int
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
Product (상품)
- product_id (id) — bigint — Primary key — NOT NULL
- name (상품명) — varchar
- description (설명) — text
- price (가격) — int
- image_url (이미지) — varchar
- category (팝콘/음료/스낵) — enum
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
ReservationSeat (예매 좌석)
- reserve_seat_id (id) — bigint — Primary key — NOT NULL
- showtime_id — bigint — Foreign key → Showtime.showtime_id — NOT NULL
- ticket_id — bigint — Foreign key → Ticket.ticket_id — NOT NULL
- screen_id — bigint — Foreign key → Screen.screen_id — NOT NULL
- status (좌석 상태) — enum
- seat_row (좌석 열) — varchar
- seat_col (좌석 행) — varchar
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
Screen (상영관)
- screen_id (id) — bigint — Primary key — NOT NULL
- theater_id (theate_id) — bigint — Foreign key → Theater.theater_id — NOT NULL
- name (상영관 이름) — varchar
- type (특별관, 일반관) — enum
- total_row (좌석 헹의 게수) — int
- total_col (좌석 열의 개수) — int
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
Showtime (상영 시간표)
- showtime_id (id) — bigint — Primary key — NOT NULL
- screen_id — bigint — Foreign key → Screen.screen_id — NOT NULL
- movie_id — bigint — Foreign key → Movie.movie_id — NOT NULL
- date (상영 날짜) — date
- start_time (시작 시간) — date
- end_time (종료 시간) — date
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
Stock (재고)
- stock_id (id) — bigint — Primary key — NOT NULL
- product_id — bigint — Foreign key → Product.product_id — NOT NULL
- theater_id — bigint — Foreign key → Theater.theater_id — NOT NULL
- stock (재고) — int
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
Theater (영화관)
- theater_id (id) — bigint — Primary key — NOT NULL
- name (이름) — varchar
- address (주소) — varchar
- access_info (오시는길) — text
- parking_info (주차 안내) — text
- region (지역구) — enum
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
TheaterFavorite (영화관 찜)
- theater_fav_id (id) — bigint — Primary key — NOT NULL
- user_id — bigint — Foreign key → User.user_id — NOT NULL
- theater_id — bigint — Foreign key → Theater.theater_id — NOT NULL
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
Ticket (예매)
- ticket_id (id) — bigint — Primary key — NOT NULL
- user_id — bigint — Foreign key → User.user_id — NOT NULL
- general_cnt (성인 인원 수) — int
- youth_cnt (청소년 인원 수) — int
- final_price (최종 결제 금액) — int
- created_at (생성 시간) — date
- updated_at (수정 시간) — date
User (유저)
- user_id (PK) — Primary key — NOT NULL
- username (아이디) — varchar
- password (비밀번호) — varchar
- created_at (생성 시간) — date
- updated_at (수정 시간) — date