Table users {
  id            int [pk]
  email         varchar
  password      varchar
  name          varchar
  phone_number  varchar
}

Table categories_master{
  id    int [pk]
  name  varchar
}

Table categories_detail{
  master_id int [not null,ref: > categories_master.id]
  id        int [pk]
  name      varchar
}

Table products {
  categories_id int [not null, ref: > categories_detail.id]
  id            int [pk]
  serial        varchar // serial DD1579-001
  title         varchar
  sub_title     varchar
  price         varchar
  quantity      int     // 수량
  eco_friendly  char
}
// fit or size 테이블 참조시 상품이 옷인지 신발인지 용품인지

Table product_detail {
  products_id   int [not null,ref: > products.id]
  id            int
  colors        varchar // 현재 컬러: 화이트/메탈릭 골드/플라이트 골드
  title         varchar 
  text          varchar
}

Table product_colors {
  products_id   int [not null,ref: > products.id]
  colors_id     int [not null,ref: > colors.id]
}

Table colors {
  id          int
  name        varchar // red, black...
}

Table product_images {
  products_id int [not null,ref: > products.id]
  id          int[pk]
  main_yn     char      // seq // 메인 이미지 노출 YN
  url         varchar
}

Table product_fits { // 의류 핏
  products_id int [not null,ref: > products.id]
  id    int[pk] 
  xs    int 
  s     int 
  m     int 
  l     int
  xl    int
}

Table product_sizes { // 사이즈 수량
  products_id int [not null,ref: > products.id]
  id    int [pk] 
  s_230 int 
  s_235 int 
  s_240 int 
  s_245 int 
  s_250 int
  s_255 int
  s_260 int 
  s_265 int 
  s_270 int 
  s_275 int 
  s_280 int 
}

Table shopping_bags {
  products_id int [not null,ref: > products.id]
  user_id     int [not null,ref: > users.id]
  id          int [pk]
  size        varchar // 230 or Small
  quantity    int       
  order_yn    char      // 주문여부 (Y인 경우 장바구니에서 invisible)
  created_at  datetime
  updated_at  datetime
}

Table orders {
  shopping_bags_id    int [not null,ref: > shopping_bags.id]
  id                  int [pk] // 주문번호 형식: 2021-11-01_0001 
  created_at          datetime
  updated_at          datetime
}

Table reviews {
  orders_id     int [not null,ref: > orders.id]
  user_id       int [not null,ref: > users.id]
  id            int [pk]
  title         varchar
  content       varchar
  rating        int       // 4.5
  created_at    datetime
  updated_at    datetime
}

Table review_images {
  reviews_id int [not null,ref: > reviews.id]
  id          int[pk]
  url         varchar
}