hirestaurant
테이블 (7)
대댓글 (Comment)
- 대댓글ID (ID) — int — 기본 키 — NOT NULL
- 유저ID (user_id) — int — 외래 키 → 유저.유저ID — NOT NULL — USER 왜래키
- 리뷰ID (review_id) — int — 외래 키 → 리뷰.리뷰ID — NOT NULL — REVIEW 외래키
- 식당ID (restaurant_id) — int — 외래 키 → 리뷰.식당ID — NOT NULL — RESTAURANT 외래키
리뷰 (Review)
- 리뷰ID (ID) — int — 기본 키 — NOT NULL — auto increment
- 식당ID (restaurant_id) — int — 외래 키 → 식당.식당ID — NOT NULL — RESTAURANT 외래키
- 식당링크 (restaurant_link) — url — validators 설정 (kakao / naver map만 유효)
- 별점 (rating) — int — default=None으로 별점이 없는 초기화 상태 시작
- 후기사진1 (image1) — img — upload_to="review_pics"
- 후기사진2 (image2) — img — upload_to="review_pics"
- 후기사진3 (image3) — img — upload_to="review_pics"
- 본문내용 (content) — text — 리뷰내용
- 작성일 (dt_created) — timestamp
- 수정일 (dt_updated) — timestamp
- 유저ID (user_id) — int — 외래 키 → 유저.유저ID — NOT NULL — auto increment
북마크 (Bookmark)
- 북마크ID (ID) — int — 기본 키 — NOT NULL
- 유저ID (user_id) — int — 외래 키 → 유저.유저ID — NOT NULL — USER 왜래키
- 식당ID (ID2) — int — 외래 키 → 식당.식당ID — NOT NULL — RESTAURANT 외래키
식당 (Restaurant)
- 식당ID (ID) — int — 기본 키 — NOT NULL — auto increment
- 식당이름 (restaurant_name) — varchar(30)
- 전화번호 (number) — varchar(20)
- 주소 (address) — text
- 식당사진1 (restaurant_image1) — img — upload_to='restaurant_pics'
- 식당사진2 (restaurant_image2) — img — upload_to='restaurant_pics',blank=True
- 식당사진3 (restaurant_image3) — img — restaurant_image3 = models.ImageField(upload_to='restaurant_pics',blank=True)
- 좋아요 (likes) — int — GenericRelation
- 위도 (latitude) — int — max_digits=9, decimal_places=6,default=0.0
- 경도 (longitude) — int — max_digits=9, decimal_places=6,default=0.0
- 음식가격 (price_range) — varchar(10) — 가격은 범위로 측정하기로 하여 int가 아닌 varchar로 결정
유저 (User)
- 유저ID (ID) — int — 기본 키 — NOT NULL — auto increment
- 닉네임 (nickname) — varchar(15) — NULL은 가질 수 있지만 UNIQUE=True로 인해 중복은 불가
- 프로필사진 (profile_pic) — img — Default: "default_profile_pic.jpg" 기본 값으로는 사진이 없을 때 해당 내용의 기본 사진을 추가
- 소개 (intro) — text
- 팔로우&팔로잉 (following) — int — 다수의 사용자가 다수의 사용자를 팔로우할 수 있는 다대다(Many-to-Many) 관계 Symmetrical: No (비대칭 관계)
좋아요 (Like)
- 좋아요ID (ID) — int — 기본 키 — NOT NULL
- 리뷰ID (review_id) — int — 외래 키 → 리뷰.리뷰ID — NOT NULL — REVIEW 왜래키
- 유저ID (user_id) — int — 외래 키 → 유저.유저ID — NOT NULL — USER 왜래키
- 생성날짜 (dt_created) — timestamp
- 식당ID (ID2) — int — 외래 키 → 리뷰.식당ID — NOT NULL — auto increment
프로필 (Profile)
- 유저ID (ID) — int — 외래 키 → 유저.유저ID — NOT NULL — USER 외래키