ALTER TABLE `mydb`.`events` 
ADD COLUMN `start_dt` DATETIME NULL DEFAULT CURRENT_TIMESTAMP AFTER `delete_dt`,
ADD COLUMN `end_dt` DATETIME NULL DEFAULT CURRENT_TIMESTAMP AFTER `start_dt`;

CREATE TABLE `menu_qna_set` (
  `idx` int unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL,
  `create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb3 COMMENT='1:1문의 템플릿';

ALTER TABLE `mydb`.`menu_qna_set` 
ADD COLUMN `contents` TEXT NULL DEFAULT '' AFTER `title`;


-- -------- log db
CREATE TABLE `t_login_history` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT,
  `day` varchar(2) NOT NULL,
  `member_idx` bigint(20) DEFAULT NULL,
  `id` varchar(30) DEFAULT NULL,
  `ip` varchar(45) DEFAULT NULL,
  `country` varchar(45) DEFAULT NULL,
  `login_domain` varchar(100) DEFAULT NULL COMMENT '접속 도메인',
  `agent` text DEFAULT NULL COMMENT 'user agent 정보',
  `agent_hash` varchar(50) DEFAULT NULL,
  `login_yn` enum('Y','N') DEFAULT NULL COMMENT 'login Y: 성공, N:실패',
  `login_datetime` datetime DEFAULT current_timestamp(),
  PRIMARY KEY (`idx`, `day`),
  KEY `index_member_id` (`id`),
  KEY `index_member_idx` (`member_idx`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='로그인 내역'
/*!50500 PARTITION BY LIST  COLUMNS(`day`)
(PARTITION t_login_history_01 VALUES IN ('01') ENGINE = InnoDB,
 PARTITION t_login_history_02 VALUES IN ('02') ENGINE = InnoDB,
 PARTITION t_login_history_03 VALUES IN ('03') ENGINE = InnoDB,
 PARTITION t_login_history_04 VALUES IN ('04') ENGINE = InnoDB,
 PARTITION t_login_history_05 VALUES IN ('05') ENGINE = InnoDB,
 PARTITION t_login_history_06 VALUES IN ('06') ENGINE = InnoDB,
 PARTITION t_login_history_07 VALUES IN ('07') ENGINE = InnoDB,
 PARTITION t_login_history_08 VALUES IN ('08') ENGINE = InnoDB,
 PARTITION t_login_history_09 VALUES IN ('09') ENGINE = InnoDB,
 PARTITION t_login_history_10 VALUES IN ('10') ENGINE = InnoDB,
 PARTITION t_login_history_11 VALUES IN ('11') ENGINE = InnoDB,
 PARTITION t_login_history_12 VALUES IN ('12') ENGINE = InnoDB,
 PARTITION t_login_history_13 VALUES IN ('13') ENGINE = InnoDB,
 PARTITION t_login_history_14 VALUES IN ('14') ENGINE = InnoDB,
 PARTITION t_login_history_15 VALUES IN ('15') ENGINE = InnoDB,
 PARTITION t_login_history_16 VALUES IN ('16') ENGINE = InnoDB,
 PARTITION t_login_history_17 VALUES IN ('17') ENGINE = InnoDB,
 PARTITION t_login_history_18 VALUES IN ('18') ENGINE = InnoDB,
 PARTITION t_login_history_19 VALUES IN ('19') ENGINE = InnoDB,
 PARTITION t_login_history_20 VALUES IN ('20') ENGINE = InnoDB,
 PARTITION t_login_history_21 VALUES IN ('21') ENGINE = InnoDB,
 PARTITION t_login_history_22 VALUES IN ('22') ENGINE = InnoDB,
 PARTITION t_login_history_23 VALUES IN ('23') ENGINE = InnoDB,
 PARTITION t_login_history_24 VALUES IN ('24') ENGINE = InnoDB,
 PARTITION t_login_history_25 VALUES IN ('25') ENGINE = InnoDB,
 PARTITION t_login_history_26 VALUES IN ('26') ENGINE = InnoDB,
 PARTITION t_login_history_27 VALUES IN ('27') ENGINE = InnoDB,
 PARTITION t_login_history_28 VALUES IN ('28') ENGINE = InnoDB,
 PARTITION t_login_history_29 VALUES IN ('29') ENGINE = InnoDB,
 PARTITION t_login_history_30 VALUES IN ('30') ENGINE = InnoDB,
 PARTITION t_login_history_31 VALUES IN ('31') ENGINE = InnoDB) */;

CREATE TABLE `t_ip_block_history` (
  `idx` int(11) NOT NULL AUTO_INCREMENT,
  `day` varchar(2) NOT NULL,
  `admin_id` varchar(50) DEFAULT NULL,
  `member_idx` int(11) DEFAULT NULL,
  `id` varchar(30) DEFAULT '',
  `login_history_idx` int(11) DEFAULT NULL,
  `ip` varchar(45) DEFAULT NULL,
  `country` varchar(45) DEFAULT NULL,
  `memo` varchar(45) DEFAULT NULL,
  `create_dt` datetime DEFAULT current_timestamp(),
  PRIMARY KEY (`idx`, `day`),
  KEY `index_member_id` (`id`),
  KEY `index_member_idx` (`member_idx`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='ip block 로그'
/*!50500 PARTITION BY LIST  COLUMNS(`day`)
(PARTITION t_ip_block_history_01 VALUES IN ('01') ENGINE = InnoDB,
 PARTITION t_ip_block_history_02 VALUES IN ('02') ENGINE = InnoDB,
 PARTITION t_ip_block_history_03 VALUES IN ('03') ENGINE = InnoDB,
 PARTITION t_ip_block_history_04 VALUES IN ('04') ENGINE = InnoDB,
 PARTITION t_ip_block_history_05 VALUES IN ('05') ENGINE = InnoDB,
 PARTITION t_ip_block_history_06 VALUES IN ('06') ENGINE = InnoDB,
 PARTITION t_ip_block_history_07 VALUES IN ('07') ENGINE = InnoDB,
 PARTITION t_ip_block_history_08 VALUES IN ('08') ENGINE = InnoDB,
 PARTITION t_ip_block_history_09 VALUES IN ('09') ENGINE = InnoDB,
 PARTITION t_ip_block_history_10 VALUES IN ('10') ENGINE = InnoDB,
 PARTITION t_ip_block_history_11 VALUES IN ('11') ENGINE = InnoDB,
 PARTITION t_ip_block_history_12 VALUES IN ('12') ENGINE = InnoDB,
 PARTITION t_ip_block_history_13 VALUES IN ('13') ENGINE = InnoDB,
 PARTITION t_ip_block_history_14 VALUES IN ('14') ENGINE = InnoDB,
 PARTITION t_ip_block_history_15 VALUES IN ('15') ENGINE = InnoDB,
 PARTITION t_ip_block_history_16 VALUES IN ('16') ENGINE = InnoDB,
 PARTITION t_ip_block_history_17 VALUES IN ('17') ENGINE = InnoDB,
 PARTITION t_ip_block_history_18 VALUES IN ('18') ENGINE = InnoDB,
 PARTITION t_ip_block_history_19 VALUES IN ('19') ENGINE = InnoDB,
 PARTITION t_ip_block_history_20 VALUES IN ('20') ENGINE = InnoDB,
 PARTITION t_ip_block_history_21 VALUES IN ('21') ENGINE = InnoDB,
 PARTITION t_ip_block_history_22 VALUES IN ('22') ENGINE = InnoDB,
 PARTITION t_ip_block_history_23 VALUES IN ('23') ENGINE = InnoDB,
 PARTITION t_ip_block_history_24 VALUES IN ('24') ENGINE = InnoDB,
 PARTITION t_ip_block_history_25 VALUES IN ('25') ENGINE = InnoDB,
 PARTITION t_ip_block_history_26 VALUES IN ('26') ENGINE = InnoDB,
 PARTITION t_ip_block_history_27 VALUES IN ('27') ENGINE = InnoDB,
 PARTITION t_ip_block_history_28 VALUES IN ('28') ENGINE = InnoDB,
 PARTITION t_ip_block_history_29 VALUES IN ('29') ENGINE = InnoDB,
 PARTITION t_ip_block_history_30 VALUES IN ('30') ENGINE = InnoDB,
 PARTITION t_ip_block_history_31 VALUES IN ('31') ENGINE = InnoDB) */;
