   PRIMARY KEY (`problem_id`),
   KEY `FK_problem_contest` (`contest_id`),
   CONSTRAINT `FK_problem_contest` FOREIGN KEY (`contest_id`) REFERENCES `contest` (`contest_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
 -- Data exporting was unselected.
 -- Dumping structure for table clanguage.problem_i18n
 CREATE TABLE IF NOT EXISTS `problem_i18n` (
   `id` bigint(20) NOT NULL,
-  `locale` enum('en','zh') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'zh',
-  `title` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
-  `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
-  `input` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
-  `output` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
-  `hint` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
-  `source` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
+  `locale` enum('en','zh') NOT NULL DEFAULT 'zh',
+  `title` longtext NOT NULL,
+  `description` longtext NOT NULL,
+  `input` longtext NOT NULL,
+  `output` longtext NOT NULL,
+  `hint` longtext NOT NULL,
+  `source` longtext NOT NULL,
   PRIMARY KEY (`id`,`locale`) USING HASH,
   CONSTRAINT `FK_problem` FOREIGN KEY (`id`) REFERENCES `problem` (`problem_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
 -- Data exporting was unselected.
 -- Dumping structure for table clanguage.solution
 CREATE TABLE IF NOT EXISTS `solution` (
   `solution_id` bigint(20) NOT NULL,
   `problem_id` bigint(20) NOT NULL,
-  `user_id` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
+  `user_id` varchar(20) NOT NULL,
   `time` bigint(20) NOT NULL DEFAULT '0',
   `memory` bigint(20) NOT NULL DEFAULT '0',
   `in_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `score` smallint(6) NOT NULL DEFAULT '0',
   `language` tinyint(4) NOT NULL,
-  `ip` varchar(39) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
+  `ip` varchar(39) NOT NULL DEFAULT '',
   `contest_id` bigint(20) DEFAULT NULL,
   `num` tinyint(4) NOT NULL DEFAULT '-1',
   `code_length` int(11) NOT NULL DEFAULT '0',

  KEY `INDEX_PROBLEM` (`problem_id`) USING HASH,
  CONSTRAINT `FK_user_problem_problem` FOREIGN KEY (`problem_id`) REFERENCES `problem` (`problem_id`),
  CONSTRAINT `FK_user_problem_users` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='缓存表，记录用户提交题目的信息。';

-- Data exporting was unselected.
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;



-- Dumping database structure for clanguage
CREATE DATABASE IF NOT EXISTS `clanguage` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `clanguage`;

-- Dumping structure for table clanguage.compileinfo
CREATE TABLE IF NOT EXISTS `compileinfo` (
  `solution_id` bigint(20) NOT NULL,
  `error` longtext NOT NULL,
  PRIMARY KEY (`solution_id`) USING HASH,
  CONSTRAINT `FK_compileinfo_solution` FOREIGN KEY (`solution_id`) REFERENCES `solution` (`solution_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Data exporting was unselected.
-- Dumping structure for table clanguage.contest
CREATE TABLE IF NOT EXISTS `contest` (
  `contest_id` bigint(20) NOT NULL,
  `title` varchar(255) NOT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime NOT NULL,
  `defunct` enum('N','Y') NOT NULL DEFAULT 'N' COMMENT 'defunct 表示该比赛有未被删除，Y表示已经被删除',
  `description` longtext NOT NULL,
  `private` int(11) DEFAULT NULL,
  PRIMARY KEY (`contest_id`) USING HASH
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Data exporting was unselected.
-- Dumping structure for table clanguage.contest_problem
CREATE TABLE IF NOT EXISTS `contest_problem` (
  `contest_id` bigint(20) NOT NULL,
  `problem_id` bigint(20) NOT NULL,
  `title` varchar(255) NOT NULL,
  `num` int(11) NOT NULL,
  PRIMARY KEY (`contest_id`,`problem_id`) USING HASH,
  UNIQUE KEY `UQ_contest_num` (`contest_id`,`num`),
  KEY `INDEX_problem` (`problem_id`) USING HASH,
  CONSTRAINT `FK_contest_problem_contest` FOREIGN KEY (`contest_id`) REFERENCES `contest` (`contest_id`),
  CONSTRAINT `FK_contest_problem_problem` FOREIGN KEY (`problem_id`) REFERENCES `problem` (`problem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='比赛的题目。';

-- Data exporting was unselected.
-- Dumping structure for table clanguage.loginlog
CREATE TABLE IF NOT EXISTS `loginlog` (
  `id` bigint(20) NOT NULL,
  `user_id` varchar(255) NOT NULL,
  `password` varchar(40) NOT NULL,
  `ip` varchar(100) NOT NULL,
  `time` datetime NOT NULL,
  `success` bit(1) NOT NULL DEFAULT b'0' COMMENT '表示登录是否成功',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='由于历史原因2016/3/21及以前的success均为1，实际登陆是否成功未知。';

-- Data exporting was unselected.
-- Dumping structure for table clanguage.mail
CREATE TABLE IF NOT EXISTS `mail` (
  `mail_id` bigint(20) NOT NULL,
  `from_user` varchar(20) NOT NULL,
  `to_user` varchar(20) NOT NULL,
  `title` varchar(200) NOT NULL DEFAULT '',
  `content` mediumtext NOT NULL,
  `new_mail` bit(1) NOT NULL DEFAULT b'1',
  `reply` bit(1) NOT NULL DEFAULT b'0',
  `in_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `defunct` enum('N','Y') NOT NULL DEFAULT 'N',
  PRIMARY KEY (`mail_id`),
  KEY `INDEX_to_user` (`to_user`),
  KEY `INDEX_from_user` (`from_user`),
  CONSTRAINT `FK_mail_users` FOREIGN KEY (`from_user`) REFERENCES `users` (`user_id`),
  CONSTRAINT `FK_mail_users_2` FOREIGN KEY (`to_user`) REFERENCES `users` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='站内信';

-- Data exporting was unselected.
-- Dumping structure for table clanguage.message
