반응형
Recent Posts
Recent Comments
관리 메뉴

개발잡부

[900gle] Table query 본문

900gle shopping/project

[900gle] Table query

닉의네임 2021. 5. 11. 22:23
반응형

900gle shopping 에서 사용 할 테이블 


-- keywords
CREATE TABLE keywords (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `keyword` varchar(200) NOT NULL,
  `use_yn` enum('Y','N') NOT NULL DEFAULT 'Y',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  unique `keyword_index` (`keyword`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;



CREATE TABLE `goods_text` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `keyword` varchar(200) DEFAULT NULL,
  `brand` varchar(500) DEFAULT NULL,
  `category` varchar(2000) DEFAULT NULL,
  `category1` varchar(200) DEFAULT NULL,
  `category2` varchar(200) DEFAULT NULL,
  `category3` varchar(200) DEFAULT NULL,
  `category4` varchar(200) DEFAULT NULL,
  `category5` varchar(200) DEFAULT NULL,
  `name` varchar(500) NOT NULL,
  `price` bigint NOT NULL, -- 가격
  `weight` float NOT NULL,   -- 가중치
  `popular` float NOT NULL,  -- 인기도
  `image` varchar(400) DEFAULT NULL,
  `feature_vector` text NOT NULL, -- 특징점 백터
  `type` varchar(50) NOT NULL,
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `updated_time_index` (`updated_time`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;



-- 상품테이블 2

CREATE TABLE `goods` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `keyword` varchar(200) DEFAULT NULL,
  `brand` varchar(500) DEFAULT NULL,
  `category` varchar(2000) DEFAULT NULL,
  `category1` varchar(200) DEFAULT NULL,
  `category2` varchar(200) DEFAULT NULL,
  `category3` varchar(200) DEFAULT NULL,
  `category4` varchar(200) DEFAULT NULL,
  `category5` varchar(200) DEFAULT NULL,
  `name` varchar(500) NOT NULL,
  `price` bigint NOT NULL, -- 가격
  `weight` float NOT NULL,   -- 가중치
  `popular` float NOT NULL,  -- 인기도
  `image` varchar(200) DEFAULT NULL,
  `feature_vector` text NOT NULL, -- 특징점 백터
  `type` varchar(50) NOT NULL,
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `updated_time_index` (`updated_time`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;







이미지 유사도 검색으로 사용하던 테이블
-- 상품테이블 1  

CREATE TABLE `products` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `keyword` varchar(500) DEFAULT NULL,
  `brand` varchar(500) DEFAULT NULL,
  `category` varchar(2000) DEFAULT NULL,
  `category1` varchar(200) DEFAULT NULL,
  `category2` varchar(200) DEFAULT NULL,
  `category3` varchar(200) DEFAULT NULL,
  `category4` varchar(200) DEFAULT NULL,
  `category5` varchar(200) DEFAULT NULL,
  `name` varchar(500) NOT NULL,
  `price` bigint NOT NULL,
  `image` varchar(200) DEFAULT NULL,

  `image_vector` varchar(5000) DEFAULT NULL,
  `type` varchar(50) NOT NULL,
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `updated_time_index` (`updated_time`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

 

 

 

 

반응형
Comments