/*M!999999\- enable the sandbox mode */ 
-- MariaDB dump 10.19  Distrib 10.11.13-MariaDB, for osx10.20 (arm64)
--
-- Host: localhost    Database: chocomae
-- ------------------------------------------------------
-- Server version	10.11.13-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `active_app`
--

DROP TABLE IF EXISTS `active_app`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `active_app` (
  `ActiveAppID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `AppID` int(10) unsigned NOT NULL,
  PRIMARY KEY (`ActiveAppID`),
  KEY `MaestroID` (`MaestroID`),
  KEY `AppID` (`AppID`),
  CONSTRAINT `active_app_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`),
  CONSTRAINT `active_app_ibfk_2` FOREIGN KEY (`AppID`) REFERENCES `app` (`AppID`)
) ENGINE=InnoDB AUTO_INCREMENT=1012361 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `admin`
--

DROP TABLE IF EXISTS `admin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin` (
  `AdminID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Name` char(50) NOT NULL,
  `Password` char(50) NOT NULL,
  `Email` char(50) NOT NULL,
  `AccountType` int(10) unsigned NOT NULL,
  `ActivateStatus` int(10) unsigned NOT NULL,
  PRIMARY KEY (`AdminID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ads_client`
--

DROP TABLE IF EXISTS `ads_client`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `ads_client` (
  `AdsClientID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ClientName` char(50) NOT NULL,
  PRIMARY KEY (`AdsClientID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `app`
--

DROP TABLE IF EXISTS `app`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `app` (
  `AppID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `AppName` char(40) NOT NULL,
  `KoreanName` char(40) NOT NULL,
  `AppType` int(10) unsigned NOT NULL,
  `Status` int(10) unsigned NOT NULL,
  `HowToPlay` text NOT NULL,
  PRIMARY KEY (`AppID`)
) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `app_highest_record`
--

DROP TABLE IF EXISTS `app_highest_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `app_highest_record` (
  `AppHighestRecordID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `AppID` int(10) unsigned NOT NULL,
  `PlayerID` int(10) unsigned NOT NULL,
  `HighestRecord` float NOT NULL,
  `RecordDateTime` datetime NOT NULL,
  PRIMARY KEY (`AppHighestRecordID`),
  KEY `MaestroID` (`MaestroID`),
  KEY `AppID` (`AppID`),
  KEY `PlayerID` (`PlayerID`),
  CONSTRAINT `app_highest_record_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`),
  CONSTRAINT `app_highest_record_ibfk_2` FOREIGN KEY (`AppID`) REFERENCES `app` (`AppID`),
  CONSTRAINT `app_highest_record_ibfk_3` FOREIGN KEY (`PlayerID`) REFERENCES `player` (`PlayerID`)
) ENGINE=InnoDB AUTO_INCREMENT=1149769 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `banned_word`
--

DROP TABLE IF EXISTS `banned_word`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `banned_word` (
  `BannedWordID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Word` char(50) NOT NULL,
  PRIMARY KEY (`BannedWordID`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `best_record`
--

DROP TABLE IF EXISTS `best_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `best_record` (
  `BestRecordID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `AppID` int(10) unsigned NOT NULL,
  `PlayerID` int(10) unsigned NOT NULL,
  `BestRecord` float NOT NULL,
  `RecordDateTime` datetime NOT NULL,
  PRIMARY KEY (`BestRecordID`),
  KEY `MaestroID` (`MaestroID`),
  KEY `AppID` (`AppID`),
  KEY `PlayerID` (`PlayerID`),
  CONSTRAINT `best_record_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`),
  CONSTRAINT `best_record_ibfk_2` FOREIGN KEY (`AppID`) REFERENCES `app` (`AppID`),
  CONSTRAINT `best_record_ibfk_3` FOREIGN KEY (`PlayerID`) REFERENCES `player` (`PlayerID`)
) ENGINE=InnoDB AUTO_INCREMENT=1664753 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `license_maestro_password`
--

DROP TABLE IF EXISTS `license_maestro_password`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `license_maestro_password` (
  `LicenseMaestroPasswordID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `Password` int(10) unsigned NOT NULL,
  PRIMARY KEY (`LicenseMaestroPasswordID`),
  KEY `MaestroID` (`MaestroID`),
  CONSTRAINT `license_maestro_password_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`)
) ENGINE=InnoDB AUTO_INCREMENT=607 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `license_score`
--

DROP TABLE IF EXISTS `license_score`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `license_score` (
  `LicenseScoreID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `PlayerID` int(10) unsigned NOT NULL,
  `SubjectName` char(50) NOT NULL,
  `Score` int(10) unsigned NOT NULL,
  `ScoreDateTime` datetime NOT NULL,
  PRIMARY KEY (`LicenseScoreID`),
  KEY `MaestroID` (`MaestroID`),
  KEY `PlayerID` (`PlayerID`),
  CONSTRAINT `license_score_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`),
  CONSTRAINT `license_score_ibfk_2` FOREIGN KEY (`PlayerID`) REFERENCES `player` (`PlayerID`)
) ENGINE=InnoDB AUTO_INCREMENT=392 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `license_time`
--

DROP TABLE IF EXISTS `license_time`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `license_time` (
  `LicenseTimeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `PlayerID` int(10) unsigned NOT NULL,
  `StartTime` int(10) unsigned NOT NULL,
  `LeftTime` int(11) NOT NULL,
  `SavedDateTime` datetime NOT NULL,
  `SubjectName` char(50) NOT NULL,
  PRIMARY KEY (`LicenseTimeID`),
  KEY `MaestroID` (`MaestroID`),
  KEY `PlayerID` (`PlayerID`),
  CONSTRAINT `license_time_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`),
  CONSTRAINT `license_time_ibfk_2` FOREIGN KEY (`PlayerID`) REFERENCES `player` (`PlayerID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `maestro`
--

DROP TABLE IF EXISTS `maestro`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `maestro` (
  `MaestroID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Name` char(50) NOT NULL,
  `Password` char(50) NOT NULL,
  `Email` char(50) NOT NULL,
  `AccountType` int(10) unsigned NOT NULL COMMENT '계정종류, 1:20명, 2:50명, 3:100명, 4:500명, 5:1000명',
  `ActivateStatus` int(10) unsigned NOT NULL COMMENT '활성상태, 0:미승인, 1:체험, 2:활성화, 100:등록취소',
  `AvailableActivateDateTime` datetime NOT NULL,
  `PlayerCount` int(10) unsigned NOT NULL,
  `AcceptClausesDateTime` datetime NOT NULL,
  `AllowEditEnterCode` int(10) unsigned NOT NULL COMMENT '학생 입장번호 변경 허용 여부, 0:불허, 1:허용',
  `MaestroTestID` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`MaestroID`)
) ENGINE=InnoDB AUTO_INCREMENT=321 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `maestro_extension`
--

DROP TABLE IF EXISTS `maestro_extension`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `maestro_extension` (
  `MaestroExtensionID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `AccountType` int(10) unsigned NOT NULL COMMENT '1: 20명(1만원), 2: 50명(2만원), 3: 100명(3만원), 4: 50명(4만원), 5: 1,000명(5만원)',
  `RequestedDateTime` datetime NOT NULL,
  `Status` int(10) unsigned NOT NULL COMMENT '처리 상태 - 1: 요청, 2: 취소, 3: 연장 적용',
  `MaestroID` int(10) unsigned NOT NULL,
  PRIMARY KEY (`MaestroExtensionID`),
  KEY `MaestroID` (`MaestroID`),
  CONSTRAINT `maestro_extension_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`)
) ENGINE=InnoDB AUTO_INCREMENT=280 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `maestro_log`
--

DROP TABLE IF EXISTS `maestro_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `maestro_log` (
  `MaestroLogID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Type` char(50) NOT NULL,
  `MaestroID` int(10) unsigned NOT NULL,
  `LogDateTime` datetime NOT NULL,
  `Remark` char(100) NOT NULL,
  PRIMARY KEY (`MaestroLogID`)
) ENGINE=InnoDB AUTO_INCREMENT=787 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `maestro_upgrade`
--

DROP TABLE IF EXISTS `maestro_upgrade`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `maestro_upgrade` (
  `MaestroUpgradeID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `RegisteredActivateStatus` int(10) unsigned NOT NULL DEFAULT 1,
  `RegisteredAccountType` int(10) NOT NULL COMMENT '1: 20명(1만원), 2: 50명(2만원), 3: 100명(3만원), 4: 50명(4만원), 5: 1,000명(5만원)',
  `RequestedAccountType` int(10) unsigned NOT NULL COMMENT '1: 20명(1만원), 2: 50명(2만원), 3: 100명(3만원), 4: 50명(4만원), 5: 1,000명(5만원)',
  `RequestedDateTime` datetime NOT NULL,
  `Status` int(10) unsigned NOT NULL COMMENT '처리 상태 - 1: 요청, 2: 취소, 3: 업그레이드 적용',
  `MaestroID` int(10) unsigned NOT NULL,
  PRIMARY KEY (`MaestroUpgradeID`),
  KEY `MaestroID` (`MaestroID`),
  CONSTRAINT `maestro_upgrade_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`)
) ENGINE=InnoDB AUTO_INCREMENT=78 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `player`
--

DROP TABLE IF EXISTS `player`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `player` (
  `PlayerID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `Name` char(50) NOT NULL,
  `EnterCode` char(8) NOT NULL,
  `AccountType` int(10) unsigned DEFAULT 0,
  PRIMARY KEY (`PlayerID`),
  KEY `MaestroID` (`MaestroID`),
  CONSTRAINT `player_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`)
) ENGINE=InnoDB AUTO_INCREMENT=95911 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `typing_exam_ads`
--

DROP TABLE IF EXISTS `typing_exam_ads`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `typing_exam_ads` (
  `TypingExamAdsID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `AdsClientID` int(10) unsigned NOT NULL,
  `WritingID` int(10) unsigned NOT NULL,
  `FromDateTime` datetime NOT NULL,
  `ToDateTime` datetime NOT NULL,
  `Status` int(10) unsigned NOT NULL,
  `Cost` float NOT NULL,
  PRIMARY KEY (`TypingExamAdsID`),
  KEY `AdsClientID` (`AdsClientID`),
  KEY `WritingID` (`WritingID`),
  CONSTRAINT `typing_exam_ads_ibfk_1` FOREIGN KEY (`AdsClientID`) REFERENCES `ads_client` (`AdsClientID`),
  CONSTRAINT `typing_exam_ads_ibfk_2` FOREIGN KEY (`WritingID`) REFERENCES `writing` (`WritingID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `typing_exam_highest_record`
--

DROP TABLE IF EXISTS `typing_exam_highest_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `typing_exam_highest_record` (
  `TypingExamHighestRecordID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `PlayerID` int(10) unsigned NOT NULL,
  `WritingID` int(10) unsigned NOT NULL,
  `HighestRecord` float NOT NULL,
  `RecordDateTime` datetime NOT NULL,
  PRIMARY KEY (`TypingExamHighestRecordID`),
  KEY `MaestroID` (`MaestroID`),
  KEY `PlayerID` (`PlayerID`),
  KEY `WritingID` (`WritingID`)
) ENGINE=InnoDB AUTO_INCREMENT=34221 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `typing_exam_record`
--

DROP TABLE IF EXISTS `typing_exam_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `typing_exam_record` (
  `TypingExamRecordID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MaestroID` int(10) unsigned NOT NULL,
  `PlayerID` int(10) unsigned NOT NULL,
  `WritingID` int(10) unsigned NOT NULL,
  `Record` float NOT NULL,
  `RecordDateTime` datetime NOT NULL,
  PRIMARY KEY (`TypingExamRecordID`),
  KEY `MaestroID` (`MaestroID`),
  KEY `PlayerID` (`PlayerID`),
  KEY `WritingID` (`WritingID`),
  CONSTRAINT `typing_exam_record_ibfk_1` FOREIGN KEY (`MaestroID`) REFERENCES `maestro` (`MaestroID`),
  CONSTRAINT `typing_exam_record_ibfk_2` FOREIGN KEY (`PlayerID`) REFERENCES `player` (`PlayerID`),
  CONSTRAINT `typing_exam_record_ibfk_3` FOREIGN KEY (`WritingID`) REFERENCES `writing` (`WritingID`)
) ENGINE=InnoDB AUTO_INCREMENT=242087 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `writing`
--

DROP TABLE IF EXISTS `writing`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `writing` (
  `WritingID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ActivateStatus` int(10) NOT NULL,
  `Language` char(10) NOT NULL,
  `Name` char(50) NOT NULL,
  `Filename` char(50) NOT NULL,
  `Writer` char(50) NOT NULL,
  `WriterID` int(10) unsigned DEFAULT NULL,
  `UpdateDate` datetime NOT NULL,
  `LetterCount` int(10) unsigned NOT NULL,
  PRIMARY KEY (`WritingID`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-05-26 21:54:57
