-- MySQL Workbench Forward Engineering

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

-- -----------------------------------------------------
-- Schema eod_authentication
-- -----------------------------------------------------
-- 인증 데이터베이스
-- -----------------------------------------------------
-- Schema eod_game
-- -----------------------------------------------------
-- 게임 데이터베이스
-- -----------------------------------------------------
-- Schema eod_log
-- -----------------------------------------------------
-- 로그 데이터베이스
-- -----------------------------------------------------
-- Schema eod_ranking
-- -----------------------------------------------------
-- 랭킹 데이터베이스
-- -----------------------------------------------------
-- Schema eod_community
-- -----------------------------------------------------
-- 커뮤니티 데이터베이스
-- -----------------------------------------------------
-- Schema eod_tool
-- -----------------------------------------------------
-- 서비스 관리도구용 데이터베이스

-- -----------------------------------------------------
-- Schema eod_tool
--
-- 서비스 관리도구용 데이터베이스
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `eod_tool` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
-- -----------------------------------------------------
-- Schema eod_configuration
-- -----------------------------------------------------
-- 서비스 설정 데이터베이스
-- -----------------------------------------------------
-- Schema eod_global
-- -----------------------------------------------------
-- 전역 서비스 관리 데이터베이스
USE `eod_tool` ;

-- -----------------------------------------------------
-- Table `eod_tool`.`table_account`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_account` (
  `user_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `email` VARCHAR(50) NOT NULL DEFAULT '',
  `password` VARCHAR(20) NOT NULL DEFAULT '',
  `name` VARCHAR(30) NULL DEFAULT '',
  `company` VARCHAR(20) NULL DEFAULT '',
  `department` VARCHAR(20) NULL DEFAULT '',
  `phone_number` VARCHAR(15) NULL DEFAULT '',
  `access_right` VARCHAR(500) NULL DEFAULT '',
  `update_datetime` DATETIME NULL DEFAULT '1000-01-01 00:00:00',
  `creation_datetime` DATETIME NULL DEFAULT '1000-01-01 00:00:00',
  PRIMARY KEY (`user_id`),
  UNIQUE INDEX `email_UNIQUE` (`email` ASC))
ENGINE = InnoDB
COMMENT = '관리툴 사용자 계정 정보';


-- -----------------------------------------------------
-- Table `eod_tool`.`table_sanctions`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_sanctions` (
  `no` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `nickname` VARCHAR(50) NOT NULL DEFAULT '',
  `sanctions_level` TINYINT(4) NOT NULL DEFAULT '0',
  `sanctions_datetime` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00',
  `reason_text` VARCHAR(100) NOT NULL DEFAULT '',
  `disposer` VARCHAR(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`no`))
ENGINE = InnoDB
COMMENT = '계정 처벌 정보';


-- -----------------------------------------------------
-- Table `eod_tool`.`table_coupon`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_coupon` (
  `no` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `coupon_group` VARCHAR(4) NOT NULL DEFAULT '',
  `count` INT(11) NOT NULL DEFAULT '0',
  `reward1` INT(11) NOT NULL DEFAULT '0',
  `count1` INT(11) NOT NULL DEFAULT '0',
  `reward2` INT(11) NOT NULL DEFAULT '0',
  `count2` INT(11) NOT NULL DEFAULT '0',
  `reward3` INT(11) NOT NULL DEFAULT '0',
  `count3` INT(11) NOT NULL DEFAULT '0',
  `reward4` INT(11) NOT NULL DEFAULT '0',
  `count4` INT(11) NOT NULL DEFAULT '0',
  `reward5` INT(11) NOT NULL DEFAULT '0',
  `count5` INT(11) NOT NULL DEFAULT '0',
  `creation_datetime` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00',
  `expiration_date` DATE NOT NULL DEFAULT '1000-01-01',
  `reason_text` VARCHAR(100) NOT NULL DEFAULT '',
  `disposer` VARCHAR(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`no`))
ENGINE = InnoDB
COMMENT = '쿠폰 발행 정보';


-- -----------------------------------------------------
-- Table `eod_tool`.`table_keyword_coupon`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_keyword_coupon` (
  `no` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `keyword` VARCHAR(20) NOT NULL DEFAULT '',
  `reward1` INT(11) NOT NULL DEFAULT 0,
  `count1` INT(11) NOT NULL DEFAULT 0,
  `reward2` INT(11) NOT NULL DEFAULT 0,
  `count2` INT(11) NOT NULL DEFAULT 0,
  `reward3` INT(11) NOT NULL DEFAULT 0,
  `count3` INT(11) NOT NULL DEFAULT 0,
  `reward4` INT(11) NOT NULL DEFAULT 0,
  `count4` INT(11) NOT NULL DEFAULT 0,
  `reward5` INT(11) NOT NULL DEFAULT 0,
  `count5` INT(11) NOT NULL DEFAULT 0,
  `creation_datetime` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00',
  `expiration_date` DATE NOT NULL DEFAULT '1000-01-01',
  `reason_text` VARCHAR(100) NOT NULL DEFAULT '',
  `disposer` VARCHAR(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`no`))
ENGINE = InnoDB
COMMENT = '키워드 쿠폰 정보';


-- -----------------------------------------------------
-- Table `eod_tool`.`table_bulk_insert`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_bulk_insert` (
  `no` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `nickname` VARCHAR(50) NOT NULL DEFAULT '',
  `reward_code` INT(11) NOT NULL DEFAULT '0',
  `reward_count` INT(11) NOT NULL DEFAULT '0',
  `inserted_datetime` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00',
  `reason_text` VARCHAR(100) NOT NULL DEFAULT '',
  `disposer` VARCHAR(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`no`))
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `eod_tool`.`table_in_game_always_event`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_in_game_always_event` (
  `no` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` INT(11) NOT NULL DEFAULT 0,
  `value` INT(11) NOT NULL DEFAULT 0,
  `include_day_of_week` VARCHAR(13) CHARACTER SET 'utf8' NOT NULL DEFAULT '',
  `start_time` TIME NOT NULL DEFAULT '00:00:00',
  `end_time` TIME NOT NULL DEFAULT '00:00:00',
  `reason_text` VARCHAR(100) CHARACTER SET 'utf8' NULL DEFAULT NULL,
  `disposer` VARCHAR(20) CHARACTER SET 'utf8' NULL DEFAULT NULL,
  PRIMARY KEY (`no`))
ENGINE = InnoDB
COMMENT = '게임 서비스 상시 이벤트 정보';


-- -----------------------------------------------------
-- Table `eod_tool`.`table_in_game_event`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_in_game_event` (
  `no` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` INT(11) NOT NULL DEFAULT 0,
  `addition` INT(11) NOT NULL DEFAULT 0,
  `start_date` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00',
  `end_date` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00',
  `reason_text` VARCHAR(100) NOT NULL DEFAULT '',
  `disposer` VARCHAR(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`no`))
ENGINE = InnoDB
COMMENT = '게임 서비스 이벤트 정보';


-- -----------------------------------------------------
-- Table `eod_tool`.`table_connect_event`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_connect_event` (
  `no` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `reward1` INT(11) NOT NULL DEFAULT '0',
  `count1` INT(11) NOT NULL DEFAULT '0',
  `reward2` INT(11) NOT NULL DEFAULT '0',
  `count2` INT(11) NOT NULL DEFAULT '0',
  `reward3` INT(11) NOT NULL DEFAULT '0',
  `count3` INT(11) NOT NULL DEFAULT '0',
  `reward4` INT(11) NOT NULL DEFAULT '0',
  `count4` INT(11) NOT NULL DEFAULT '0',
  `reward5` INT(11) NOT NULL DEFAULT '0',
  `count5` INT(11) NOT NULL DEFAULT '0',
  `start_date` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00',
  `end_date` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00',
  `reason_text` VARCHAR(100) NOT NULL DEFAULT '',
  `disposer` VARCHAR(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`no`))
ENGINE = InnoDB
COMMENT = '접속 이벤트 설정 정보';


-- -----------------------------------------------------
-- Table `eod_tool`.`table_notice`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `eod_tool`.`table_notice` (
  `no` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` INT(11) NOT NULL,
  `message` VARCHAR(100) NOT NULL,
  `area` INT(11) NOT NULL,
  `condition` INT(11) NOT NULL,
  `direct` INT(11) NOT NULL,
  `speed` INT(11) NOT NULL,
  `repeat` INT(11) NOT NULL,
  `keep` INT(11) NOT NULL,
  `term` INT(11) NOT NULL,
  `send_datetime` DATETIME NOT NULL,
  `disposer` VARCHAR(20) NOT NULL,
  PRIMARY KEY (`no`))
ENGINE = InnoDB
COMMENT = '공지 정보';


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
