-- =====================================================
-- MU_PROCEDURE_REVIEW : 시술후기 전용 테이블
-- 기존 HP_BEFORE_AFTER_PHOTO_BBS 대신 사용
-- =====================================================

CREATE TABLE `MU_PROCEDURE_REVIEW` (
  `MU_PROCEDURE_REVIEW_ID` varchar(25) NOT NULL COMMENT '시술후기 식별자',
  `MU_MEMBER_ID` varchar(25) NOT NULL COMMENT '작성자 식별자',
  `CATEGORY_NO` int(11) DEFAULT NULL COMMENT '카테고리 번호',
  `TITLE` varchar(200) NOT NULL COMMENT '제목',
  `CONTENT` text NOT NULL COMMENT '내용 (HTML - Quill 에디터)',
  `HASHTAG` varchar(500) DEFAULT NULL COMMENT '해시태그',
  `BEFORE_PHOTO_ATTACHFILE_ID` varchar(30) DEFAULT NULL COMMENT 'Before 사진 첨부파일 식별자',
  `AFTER_PHOTO_ATTACHFILE_ID` varchar(30) DEFAULT NULL COMMENT 'After 사진 첨부파일 식별자',
  `VIEW_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '조회수',
  `USE_YN` char(1) NOT NULL DEFAULT 'Y' COMMENT '사용여부 (Y:사용, N:삭제)',
  `REG_ID` varchar(25) NOT NULL COMMENT '등록자',
  `REG_DATE` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '등록일자',
  `MOD_ID` varchar(25) NOT NULL COMMENT '수정자',
  `MOD_DATE` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '수정일자',
  PRIMARY KEY (`MU_PROCEDURE_REVIEW_ID`),
  KEY `idx_mu_procedure_review_category` (`CATEGORY_NO`),
  KEY `idx_mu_procedure_review_reg_date` (`REG_DATE`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='시술후기 정보';

-- 시퀀스 테이블
CREATE TABLE `MU_PROCEDURE_REVIEW_SEQ` (
  `next_not_cached_value` bigint(21) NOT NULL,
  `minimum_value` bigint(21) NOT NULL,
  `maximum_value` bigint(21) NOT NULL,
  `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
  `increment` bigint(21) NOT NULL COMMENT 'increment value',
  `cache_size` bigint(21) unsigned NOT NULL,
  `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
  `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
) ENGINE=InnoDB SEQUENCE=1;

INSERT INTO `MU_PROCEDURE_REVIEW_SEQ` VALUES (1,1,99999999999,1,1,0,1,0);
