CREATE TABLE `tb_static_bonus` (
  `idx` int(11) NOT NULL DEFAULT 0,
  `desc` varchar(128) DEFAULT '',
  `flag` enum('ON','OFF') DEFAULT 'ON',
  `bonus_1_desc` varchar(128) DEFAULT '',
  `bonus_1_flag` enum('ON','OFF') DEFAULT 'ON',
  `bonus_2_desc` varchar(128) DEFAULT '',
  `bonus_2_flag` enum('ON','OFF') DEFAULT 'ON',
  `create_dt` datetime DEFAULT current_timestamp(),
  `update_dt` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='보너스 포인트 관리 테이블 ';

ALTER TABLE `charge_type` 
ADD COLUMN `bonus_1_charge_first_money` INT(11) NULL DEFAULT 0 AFTER `name`,
ADD COLUMN `bonus_1_charge_first_per` INT(11) NULL DEFAULT 0 AFTER `bonus_1_charge_first_money`,
ADD COLUMN `bonus_1_charge_first_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_1_charge_first_per`,
ADD COLUMN `bonus_1_charge_money` INT(11) NULL DEFAULT 0 AFTER `bonus_1_charge_first_max_money`,
ADD COLUMN `bonus_1_charge_per` INT(11) NULL DEFAULT 0 AFTER `bonus_1_charge_money`,
ADD COLUMN `bonus_1_charge_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_1_charge_per`,
ADD COLUMN `bonus_2_charge_first_money` INT(11) NULL DEFAULT 0 AFTER `bonus_1_charge_max_money`,
ADD COLUMN `bonus_2_charge_first_per` INT(11) NULL DEFAULT 0 AFTER `bonus_2_charge_first_money`,
ADD COLUMN `bonus_2_charge_first_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_2_charge_first_per`,
ADD COLUMN `bonus_2_charge_money` INT(11) NULL DEFAULT 0 AFTER `bonus_2_charge_first_max_money`,
ADD COLUMN `bonus_2_charge_per` INT(11) NULL DEFAULT 0 AFTER `bonus_2_charge_money`,
ADD COLUMN `bonus_2_charge_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_2_charge_money`,
ADD COLUMN `create_dt` DATETIME NULL DEFAULT CURRENT_TIMESTAMP() AFTER `bonus_2_charge_per`,
ADD COLUMN `update_dt` DATETIME NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP() AFTER `create_dt`;

ALTER TABLE `member_money_charge_history` 
ADD COLUMN `bonus_option_idx` INT(11) NULL DEFAULT 0 COMMENT '선택한 보너스 옵션(-1:적용안함, 0:디폴트 보너스,1: 1번보너스 2:2번 보너스)' AFTER `charge_point_yn`,
ADD COLUMN `ratio_value` INT(11) NULL DEFAULT 0 COMMENT '보너스 비율' AFTER `bonus_option_idx`,
ADD COLUMN `const_value` INT(11) NULL DEFAULT 0 COMMENT '보너스 금액' AFTER `ratio_value`,
ADD COLUMN `manual_bonus_point` INT(11) NULL DEFAULT 0 COMMENT '수동지급 포인트' AFTER `const_value`,
ADD COLUMN `bonus_level` INT(11) NULL DEFAULT 0 AFTER `manual_bonus_point`;

-- 데이터
INSERT INTO `tb_static_bonus` VALUES (1,'※ 배팅롤링 : 스포츠 100%, 그 외 게임 200%','ON','※ 배팅롤링 : 스포츠 100%(단폴제외), E스포츠 200%, 미니,해쉬,슬롯 300%, 카지노 600%','ON','※ 배팅롤링 : 스포츠 100%(단폴/투폴제외), 그 외 게임 불인정','ON','2023-01-24 18:21:41','2023-01-26 15:50:53');