-- MySQL dump 10.14  Distrib 5.5.60-MariaDB, for Linux (x86_64)
--
-- Host: rm-bp13v5020p7828r5r.mysql.rds.aliyuncs.com    Database: testeducoderweb
-- ------------------------------------------------------
-- Server version	5.6.16-log

/*!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 utf8 */;
/*!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 `activities`
--

DROP TABLE IF EXISTS `activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `act_id` int(11) NOT NULL,
  `act_type` varchar(255) NOT NULL,
  `user_id` int(11) NOT NULL,
  `activity_container_id` int(11) DEFAULT NULL,
  `activity_container_type` varchar(255) DEFAULT '',
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_activities_on_user_id` (`user_id`),
  KEY `index_activities_on_act_id_and_act_type` (`act_id`,`act_type`),
  KEY `index_activities_on_user_id_and_act_type` (`user_id`,`act_type`)
) ENGINE=InnoDB AUTO_INCREMENT=126237 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `activity_notifies`
--

DROP TABLE IF EXISTS `activity_notifies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activity_notifies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `activity_container_id` int(11) DEFAULT NULL,
  `activity_container_type` varchar(255) DEFAULT NULL,
  `activity_id` int(11) DEFAULT NULL,
  `activity_type` varchar(255) DEFAULT NULL,
  `notify_to` int(11) DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `is_read` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_an_notify_to` (`notify_to`),
  KEY `index_an_created_on` (`created_on`),
  KEY `index_an_activity_container_id` (`activity_container_id`,`activity_container_type`)
) ENGINE=InnoDB AUTO_INCREMENT=1294 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `api_keys`
--

DROP TABLE IF EXISTS `api_keys`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api_keys` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `access_token` varchar(255) DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `active` tinyint(1) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_api_keys_on_user_id` (`user_id`),
  KEY `index_api_keys_on_access_token` (`access_token`)
) ENGINE=InnoDB AUTO_INCREMENT=3097 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `applied_contests`
--

DROP TABLE IF EXISTS `applied_contests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `applied_contests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `contest_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `role` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_applied_contests_on_contest_id` (`contest_id`),
  KEY `index_applied_contests_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=112 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `applied_messages`
--

DROP TABLE IF EXISTS `applied_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `applied_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `applied_id` int(11) DEFAULT NULL,
  `applied_type` varchar(255) DEFAULT NULL,
  `viewed` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `applied_user_id` int(11) DEFAULT NULL,
  `role` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12200 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `applied_projects`
--

DROP TABLE IF EXISTS `applied_projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `applied_projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `role` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1131 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `apply_actions`
--

DROP TABLE IF EXISTS `apply_actions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `apply_actions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `dealer_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` tinyint(4) DEFAULT '0',
  `apply_reason` text,
  `noticed` tinyint(1) DEFAULT '0',
  `ip_addr` varchar(255) DEFAULT NULL,
  `reject_description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_apply_actions_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=55811 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `apply_add_departments`
--

DROP TABLE IF EXISTS `apply_add_departments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `apply_add_departments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `department_id` int(11) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `remarks` text,
  `user_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_apply_add_departments_on_department_id` (`department_id`),
  KEY `index_apply_add_departments_on_school_id` (`school_id`),
  KEY `index_apply_add_departments_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1881 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `apply_add_schools`
--

DROP TABLE IF EXISTS `apply_add_schools`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `apply_add_schools` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `remarks` varchar(255) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1284 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `apply_homeworks`
--

DROP TABLE IF EXISTS `apply_homeworks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `apply_homeworks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `status` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `homework_common_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_apply_homeworks_on_user_id` (`user_id`),
  KEY `index_apply_homeworks_on_homework_common_id` (`homework_common_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `apply_project_masters`
--

DROP TABLE IF EXISTS `apply_project_masters`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `apply_project_masters` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `apply_type` varchar(255) DEFAULT NULL,
  `apply_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `apply_resources`
--

DROP TABLE IF EXISTS `apply_resources`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `apply_resources` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `status` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `attachment_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `content` text,
  `apply_user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `apply_user_authentications`
--

DROP TABLE IF EXISTS `apply_user_authentications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `apply_user_authentications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `auth_type` int(11) DEFAULT NULL,
  `remarks` varchar(255) DEFAULT NULL,
  `dealer` int(11) DEFAULT NULL,
  `deal_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `is_delete` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_apply_user_authentications_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5735 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ar_internal_metadata`
--

DROP TABLE IF EXISTS `ar_internal_metadata`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ar_internal_metadata` (
  `key` varchar(255) NOT NULL,
  `value` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `article_homepages`
--

DROP TABLE IF EXISTS `article_homepages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `article_homepages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `content` text,
  `user_id` int(11) DEFAULT NULL,
  `homepage_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_article_homepages_on_user_id` (`user_id`),
  KEY `index_article_homepages_on_homepage_id` (`homepage_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1632 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `at_messages`
--

DROP TABLE IF EXISTS `at_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `at_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `at_message_id` int(11) DEFAULT NULL,
  `at_message_type` varchar(255) DEFAULT NULL,
  `viewed` tinyint(1) DEFAULT '0',
  `container_type` varchar(255) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `sender_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_at_messages_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4562 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `attachment_group_settings`
--

DROP TABLE IF EXISTS `attachment_group_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attachment_group_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `attachment_id` int(11) DEFAULT NULL,
  `course_group_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `publish_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_attachment_group_settings_on_attachment_id` (`attachment_id`),
  KEY `index_attachment_group_settings_on_course_group_id` (`course_group_id`),
  KEY `index_attachment_group_settings_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=209 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `attachment_histories`
--

DROP TABLE IF EXISTS `attachment_histories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attachment_histories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `filename` varchar(255) DEFAULT '',
  `disk_filename` varchar(255) DEFAULT '',
  `filesize` int(11) DEFAULT '0',
  `content_type` varchar(255) DEFAULT '',
  `digest` varchar(60) DEFAULT '',
  `downloads` int(11) DEFAULT '0',
  `author_id` int(11) DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `description` text,
  `disk_directory` varchar(255) DEFAULT NULL,
  `attachtype` int(11) DEFAULT NULL,
  `is_public` int(11) DEFAULT NULL,
  `copy_from` int(11) DEFAULT NULL,
  `quotes` int(11) DEFAULT NULL,
  `version` int(11) DEFAULT NULL,
  `attachment_id` int(11) DEFAULT NULL,
  `is_publish` int(11) DEFAULT '1',
  `publish_time` date DEFAULT NULL,
  `cloud_url` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=407 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `attachments`
--

DROP TABLE IF EXISTS `attachments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attachments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(30) DEFAULT NULL,
  `filename` varchar(255) NOT NULL DEFAULT '',
  `disk_filename` varchar(255) NOT NULL DEFAULT '',
  `filesize` int(11) NOT NULL DEFAULT '0',
  `content_type` varchar(255) DEFAULT '',
  `digest` varchar(60) NOT NULL DEFAULT '',
  `downloads` int(11) NOT NULL DEFAULT '0',
  `author_id` int(11) NOT NULL DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `description` text,
  `disk_directory` varchar(255) DEFAULT NULL,
  `attachtype` int(11) DEFAULT '1',
  `is_public` int(11) DEFAULT '1',
  `copy_from` int(11) DEFAULT NULL,
  `quotes` int(11) DEFAULT '0',
  `is_publish` int(11) DEFAULT '1',
  `publish_time` datetime DEFAULT NULL,
  `resource_bank_id` int(11) DEFAULT NULL,
  `unified_setting` tinyint(1) DEFAULT '1',
  `cloud_url` varchar(255) DEFAULT '',
  `course_second_category_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_attachments_on_author_id` (`author_id`),
  KEY `index_attachments_on_created_on` (`created_on`),
  KEY `index_attachments_on_container_id_and_container_type` (`container_id`,`container_type`)
) ENGINE=InnoDB AUTO_INCREMENT=380458 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `attachmentstypes`
--

DROP TABLE IF EXISTS `attachmentstypes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attachmentstypes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `typeId` int(11) NOT NULL,
  `typeName` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `attendances`
--

DROP TABLE IF EXISTS `attendances`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `attendances` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `score` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=424803 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `auth_sources`
--

DROP TABLE IF EXISTS `auth_sources`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `auth_sources` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(30) NOT NULL DEFAULT '',
  `name` varchar(60) NOT NULL DEFAULT '',
  `host` varchar(60) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `account` varchar(255) DEFAULT NULL,
  `account_password` varchar(255) DEFAULT '',
  `base_dn` varchar(255) DEFAULT NULL,
  `attr_login` varchar(30) DEFAULT NULL,
  `attr_firstname` varchar(30) DEFAULT NULL,
  `attr_lastname` varchar(30) DEFAULT NULL,
  `attr_mail` varchar(30) DEFAULT NULL,
  `onthefly_register` tinyint(1) NOT NULL DEFAULT '0',
  `tls` tinyint(1) NOT NULL DEFAULT '0',
  `filter` varchar(255) DEFAULT NULL,
  `timeout` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_auth_sources_on_id_and_type` (`id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `authentications`
--

DROP TABLE IF EXISTS `authentications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `authentications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `level` tinyint(4) DEFAULT NULL,
  `permissions` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `authentications_users`
--

DROP TABLE IF EXISTS `authentications_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `authentications_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `authentication_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6113 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bidding_users`
--

DROP TABLE IF EXISTS `bidding_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bidding_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_package_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_bidding_users_on_project_package_id` (`project_package_id`),
  KEY `index_bidding_users_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `biding_projects`
--

DROP TABLE IF EXISTS `biding_projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `biding_projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `bid_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `reward` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bids`
--

DROP TABLE IF EXISTS `bids`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bids` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `budget` varchar(255) NOT NULL,
  `author_id` int(11) DEFAULT NULL,
  `deadline` date DEFAULT NULL,
  `description` text,
  `created_on` datetime NOT NULL,
  `updated_on` datetime NOT NULL,
  `commit` int(11) DEFAULT NULL,
  `reward_type` int(11) DEFAULT NULL,
  `homework_type` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `is_evaluation` int(11) DEFAULT NULL,
  `proportion` int(11) DEFAULT '60',
  `comment_status` int(11) DEFAULT '0',
  `evaluation_num` int(11) DEFAULT '3',
  `open_anonymous_evaluation` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=761 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `blog_comments`
--

DROP TABLE IF EXISTS `blog_comments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `blog_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `blog_id` int(11) NOT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `title` varchar(255) NOT NULL DEFAULT '',
  `content` text,
  `author_id` int(11) DEFAULT NULL,
  `comments_count` int(11) NOT NULL DEFAULT '0',
  `last_comment_id` int(11) DEFAULT NULL,
  `created_on` datetime NOT NULL,
  `updated_on` datetime NOT NULL,
  `locked` tinyint(1) DEFAULT '0',
  `sticky` int(11) DEFAULT '0',
  `reply_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `root_id` int(11) DEFAULT NULL,
  `visits` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_blog_comments_on_root_id` (`root_id`)
) ENGINE=InnoDB AUTO_INCREMENT=620 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `blog_messages`
--

DROP TABLE IF EXISTS `blog_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `blog_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `blog_message_id` int(11) DEFAULT NULL,
  `blog_id` int(11) DEFAULT NULL,
  `blog_message_type` varchar(255) DEFAULT NULL,
  `viewed` tinyint(1) DEFAULT '0',
  `content` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `user_operator_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `blogs`
--

DROP TABLE IF EXISTS `blogs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `blogs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `description` text,
  `position` int(11) DEFAULT '1',
  `article_count` int(11) NOT NULL DEFAULT '0',
  `comments_count` int(11) NOT NULL DEFAULT '0',
  `last_comments_id` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `author_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `homepage_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24115 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `boards`
--

DROP TABLE IF EXISTS `boards`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `boards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL DEFAULT '',
  `description` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT '1',
  `topics_count` int(11) NOT NULL DEFAULT '0',
  `messages_count` int(11) NOT NULL DEFAULT '0',
  `last_message_id` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT '0',
  `course_id` int(11) DEFAULT NULL,
  `org_subfield_id` int(11) DEFAULT NULL,
  `contest_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `boards_project_id` (`project_id`),
  KEY `index_boards_on_last_message_id` (`last_message_id`),
  KEY `parent` (`parent_id`),
  KEY `index_boards_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8783 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bug_to_osps`
--

DROP TABLE IF EXISTS `bug_to_osps`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bug_to_osps` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `osp_id` int(11) DEFAULT NULL,
  `relative_memo_id` int(11) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `career_faqs`
--

DROP TABLE IF EXISTS `career_faqs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `career_faqs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question` varchar(255) DEFAULT NULL,
  `answer` varchar(255) DEFAULT NULL,
  `career_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `career_stage_subjects`
--

DROP TABLE IF EXISTS `career_stage_subjects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `career_stage_subjects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `career_stage_id` int(11) DEFAULT NULL,
  `subject_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=203 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `career_stages`
--

DROP TABLE IF EXISTS `career_stages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `career_stages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `position` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `career_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=116 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `careers`
--

DROP TABLE IF EXISTS `careers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `careers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `video_name` varchar(255) DEFAULT NULL,
  `video_description` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `status` tinyint(1) DEFAULT '0',
  `published_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `challenge_answers`
--

DROP TABLE IF EXISTS `challenge_answers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `challenge_answers` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `contents` longtext,
  `score` int(11) DEFAULT NULL,
  `level` int(11) DEFAULT NULL,
  `challenge_id` bigint(20) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_challenge_answers_on_challenge_id` (`challenge_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7955 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `challenge_chooses`
--

DROP TABLE IF EXISTS `challenge_chooses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `challenge_chooses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject` text,
  `challenge_id` int(11) DEFAULT NULL,
  `standard_answer` varchar(255) DEFAULT NULL,
  `answer` text,
  `score` int(11) DEFAULT NULL,
  `difficult` int(11) DEFAULT '1',
  `category` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_challenge_chooses_on_challenge_id` (`challenge_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1031 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `challenge_questions`
--

DROP TABLE IF EXISTS `challenge_questions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `challenge_questions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `option_name` text,
  `challenge_choose_id` int(11) DEFAULT NULL,
  `right_key` tinyint(1) DEFAULT NULL,
  `position` tinyint(4) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_challenge_questions_on_challenge_choose_id` (`challenge_choose_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6365 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `challenge_samples`
--

DROP TABLE IF EXISTS `challenge_samples`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `challenge_samples` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input` varchar(255) DEFAULT NULL,
  `output` varchar(255) DEFAULT NULL,
  `challenge_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `game_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `challenge_tags`
--

DROP TABLE IF EXISTS `challenge_tags`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `challenge_tags` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `challenge_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `challenge_choose_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_challenge_tags_on_challenge_id` (`challenge_id`)
) ENGINE=InnoDB AUTO_INCREMENT=51594 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `challenge_work_scores`
--

DROP TABLE IF EXISTS `challenge_work_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `challenge_work_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `student_work_id` int(11) DEFAULT NULL,
  `challenge_id` int(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `comment` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_challenge_work_scores_on_student_work_id` (`student_work_id`),
  KEY `index_challenge_work_scores_on_challenge_id` (`challenge_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `challenges`
--

DROP TABLE IF EXISTS `challenges`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `challenges` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT '0',
  `position` tinyint(4) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `task_pass` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `answer` longtext,
  `score` int(11) DEFAULT '100',
  `visits` int(11) DEFAULT '0',
  `path` text,
  `evaluation_way` int(11) DEFAULT '0',
  `difficulty` int(11) DEFAULT '1',
  `exec_path` varchar(255) DEFAULT NULL,
  `code_line` int(11) DEFAULT NULL,
  `st` tinyint(4) DEFAULT '0',
  `web_route` text,
  `picture_path` text,
  `expect_picture_path` text,
  `modify_time` datetime DEFAULT NULL,
  `challenge_tags_count` int(11) DEFAULT '0',
  `original_picture_path` varchar(255) DEFAULT NULL,
  `show_type` int(11) DEFAULT '-1',
  `test_set_score` tinyint(1) DEFAULT '0',
  `exec_time` int(11) DEFAULT '20',
  `test_set_average` tinyint(1) DEFAULT '1',
  `praises_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_challenges_on_shixun_id` (`shixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9198 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `changes`
--

DROP TABLE IF EXISTS `changes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `changes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `changeset_id` int(11) NOT NULL,
  `action` varchar(1) NOT NULL DEFAULT '',
  `path` text NOT NULL,
  `from_path` text,
  `from_revision` varchar(255) DEFAULT NULL,
  `revision` varchar(255) DEFAULT NULL,
  `branch` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `changesets_changeset_id` (`changeset_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1128132 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `changeset_parents`
--

DROP TABLE IF EXISTS `changeset_parents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `changeset_parents` (
  `changeset_id` int(11) NOT NULL,
  `parent_id` int(11) NOT NULL,
  KEY `changeset_parents_changeset_ids` (`changeset_id`),
  KEY `changeset_parents_parent_ids` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `changesets`
--

DROP TABLE IF EXISTS `changesets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `changesets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `repository_id` int(11) NOT NULL,
  `revision` varchar(255) NOT NULL,
  `committer` varchar(255) DEFAULT NULL,
  `committed_on` datetime NOT NULL,
  `comments` text,
  `commit_date` date DEFAULT NULL,
  `scmid` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `type` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `changesets_repos_rev` (`repository_id`,`revision`),
  KEY `index_changesets_on_user_id` (`user_id`),
  KEY `index_changesets_on_repository_id` (`repository_id`),
  KEY `index_changesets_on_committed_on` (`committed_on`),
  KEY `changesets_repos_scmid` (`repository_id`,`scmid`)
) ENGINE=InnoDB AUTO_INCREMENT=121390 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `changesets_issues`
--

DROP TABLE IF EXISTS `changesets_issues`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `changesets_issues` (
  `changeset_id` int(11) NOT NULL,
  `issue_id` int(11) NOT NULL,
  UNIQUE KEY `changesets_issues_ids` (`changeset_id`,`issue_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `chart_rules`
--

DROP TABLE IF EXISTS `chart_rules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chart_rules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rule_type` varchar(255) DEFAULT NULL,
  `content` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `competition_id` int(11) DEFAULT NULL,
  `competition_stage_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_chart_rules_on_competition_id` (`competition_id`),
  KEY `index_chart_rules_on_competition_stage_id` (`competition_stage_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `choose_outputs`
--

DROP TABLE IF EXISTS `choose_outputs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `choose_outputs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `challenge_choose_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `answer` varchar(255) DEFAULT NULL,
  `correct` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `code_review_assignments`
--

DROP TABLE IF EXISTS `code_review_assignments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `code_review_assignments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `issue_id` int(11) DEFAULT NULL,
  `change_id` int(11) DEFAULT NULL,
  `attachment_id` int(11) DEFAULT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `rev` varchar(255) DEFAULT NULL,
  `rev_to` varchar(255) DEFAULT NULL,
  `action_type` varchar(255) DEFAULT NULL,
  `changeset_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `code_review_project_settings`
--

DROP TABLE IF EXISTS `code_review_project_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `code_review_project_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `tracker_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `hide_code_review_tab` tinyint(1) DEFAULT '0',
  `auto_relation` int(11) DEFAULT '1',
  `assignment_tracker_id` int(11) DEFAULT NULL,
  `auto_assign` text,
  `lock_version` int(11) NOT NULL DEFAULT '0',
  `tracker_in_review_dialog` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=481 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `code_review_user_settings`
--

DROP TABLE IF EXISTS `code_review_user_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `code_review_user_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `mail_notification` int(11) NOT NULL DEFAULT '0',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `code_reviews`
--

DROP TABLE IF EXISTS `code_reviews`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `code_reviews` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `change_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `line` int(11) DEFAULT NULL,
  `updated_by_id` int(11) DEFAULT NULL,
  `lock_version` int(11) NOT NULL DEFAULT '0',
  `status_changed_from` int(11) DEFAULT NULL,
  `status_changed_to` int(11) DEFAULT NULL,
  `issue_id` int(11) DEFAULT NULL,
  `action_type` varchar(255) DEFAULT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `rev` varchar(255) DEFAULT NULL,
  `rev_to` varchar(255) DEFAULT NULL,
  `attachment_id` int(11) DEFAULT NULL,
  `file_count` int(11) NOT NULL DEFAULT '0',
  `diff_all` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `code_tests`
--

DROP TABLE IF EXISTS `code_tests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `code_tests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_id` int(11) DEFAULT NULL,
  `wait_time` int(11) DEFAULT '0',
  `language` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `time_used` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `student_work_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=759267 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `comments`
--

DROP TABLE IF EXISTS `comments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `commented_type` varchar(30) NOT NULL DEFAULT '',
  `commented_id` int(11) NOT NULL DEFAULT '0',
  `author_id` int(11) NOT NULL DEFAULT '0',
  `comments` text,
  `created_on` datetime NOT NULL,
  `updated_on` datetime NOT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `comments_count` int(11) DEFAULT '0',
  `reply_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_comments_on_commented_id_and_commented_type` (`commented_id`,`commented_type`),
  KEY `index_comments_on_author_id` (`author_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4799 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `commit_issues`
--

DROP TABLE IF EXISTS `commit_issues`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `commit_issues` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `commit_id` varchar(255) DEFAULT NULL,
  `issue_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=215 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `commits`
--

DROP TABLE IF EXISTS `commits`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `commits` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `repository_id` int(11) DEFAULT NULL,
  `version` varchar(255) DEFAULT NULL,
  `committer` varchar(255) DEFAULT NULL,
  `comments` text,
  `committed_on` datetime DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_entries`
--

DROP TABLE IF EXISTS `competition_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_entries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `competition_stage_section_id` int(11) DEFAULT NULL,
  `competition_stage_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_competition_entries_on_competition_stage_section_id` (`competition_stage_section_id`),
  KEY `index_competition_entries_on_competition_stage_id` (`competition_stage_id`)
) ENGINE=InnoDB AUTO_INCREMENT=121 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_lists`
--

DROP TABLE IF EXISTS `competition_lists`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_lists` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `competition_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_competition_lists_on_competition_id` (`competition_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_module_md_contents`
--

DROP TABLE IF EXISTS `competition_module_md_contents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_module_md_contents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `content` text,
  `competition_module_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_modules`
--

DROP TABLE IF EXISTS `competition_modules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_modules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `competition_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `hidden` tinyint(1) DEFAULT '0',
  `url` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `position` int(11) DEFAULT '0',
  `md_edit` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_competition_modules_on_competition_id` (`competition_id`)
) ENGINE=InnoDB AUTO_INCREMENT=111 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_scores`
--

DROP TABLE IF EXISTS `competition_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `score_type` varchar(255) DEFAULT NULL,
  `region` varchar(255) DEFAULT NULL,
  `cost_time` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `competition_id` int(11) DEFAULT NULL,
  `competition_stage_id` int(11) DEFAULT NULL,
  `competition_team_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_competition_scores_on_user_id` (`user_id`),
  KEY `index_competition_scores_on_competition_id` (`competition_id`),
  KEY `index_competition_scores_on_competition_stage_id` (`competition_stage_id`),
  KEY `index_competition_scores_on_competition_team_id` (`competition_team_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5874 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_staffs`
--

DROP TABLE IF EXISTS `competition_staffs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_staffs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `competition_id` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `category` varchar(255) DEFAULT NULL,
  `minimum` int(11) DEFAULT NULL,
  `maximum` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `mutiple_limited` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_stage_sections`
--

DROP TABLE IF EXISTS `competition_stage_sections`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_stage_sections` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `competition_id` int(11) DEFAULT NULL,
  `competition_stage_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `entry` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_competition_stage_sections_on_competition_id` (`competition_id`),
  KEY `index_competition_stage_sections_on_competition_stage_id` (`competition_stage_id`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_stages`
--

DROP TABLE IF EXISTS `competition_stages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_stages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `competition_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_competition_stages_on_competition_id` (`competition_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_teams`
--

DROP TABLE IF EXISTS `competition_teams`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_teams` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `competition_id` int(11) DEFAULT NULL,
  `team_type` int(11) DEFAULT '0',
  `invite_code` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `teacher_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_competition_teams_on_user_id` (`user_id`),
  KEY `index_competition_teams_on_competition_id` (`competition_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2073 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competition_text_configs`
--

DROP TABLE IF EXISTS `competition_text_configs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competition_text_configs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `competition_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `competitions`
--

DROP TABLE IF EXISTS `competitions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `competitions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `identifier` varchar(255) DEFAULT NULL,
  `status` tinyint(1) DEFAULT '0',
  `online_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `visits` int(11) DEFAULT '0',
  `competition_lists_count` int(11) DEFAULT '0',
  `min_num` int(11) DEFAULT '1',
  `max_num` int(11) DEFAULT '1',
  `enroll_end_time` datetime DEFAULT NULL,
  `sub_title` varchar(255) DEFAULT NULL,
  `published_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contest_activities`
--

DROP TABLE IF EXISTS `contest_activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contest_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `contest_id` int(11) DEFAULT NULL,
  `contest_act_id` int(11) DEFAULT NULL,
  `contest_act_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contest_activities_on_user_id` (`user_id`),
  KEY `index_contest_activities_on_contest_id` (`contest_id`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contest_member_roles`
--

DROP TABLE IF EXISTS `contest_member_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contest_member_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `contest_member_id` int(11) DEFAULT NULL,
  `role_id` int(11) DEFAULT NULL,
  `is_current` tinyint(1) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contest_member_roles_on_contest_member_id` (`contest_member_id`),
  KEY `index_contest_member_roles_on_role_id` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contest_members`
--

DROP TABLE IF EXISTS `contest_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contest_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `contest_id` int(11) DEFAULT NULL,
  `is_collect` tinyint(1) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contest_members_on_user_id` (`user_id`),
  KEY `index_contest_members_on_contest_id` (`contest_id`)
) ENGINE=InnoDB AUTO_INCREMENT=175 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contest_messages`
--

DROP TABLE IF EXISTS `contest_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contest_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `contest_id` int(11) DEFAULT NULL,
  `contest_message_id` int(11) DEFAULT NULL,
  `contest_message_type` varchar(255) DEFAULT NULL,
  `viewed` tinyint(1) DEFAULT '0',
  `content` text,
  `status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contest_messages_on_user_id` (`user_id`),
  KEY `index_contest_messages_on_contest_id` (`contest_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1983 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contestant_for_contests`
--

DROP TABLE IF EXISTS `contestant_for_contests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contestant_for_contests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `student_id` int(11) DEFAULT NULL,
  `contest_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contestant_for_contests_on_contest_id` (`contest_id`),
  KEY `index_contestant_for_contests_on_student_id` (`student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contestant_work_evaluation_distributions`
--

DROP TABLE IF EXISTS `contestant_work_evaluation_distributions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contestant_work_evaluation_distributions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `contestant_work_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contestant_work_evaluation_distributions_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contestant_work_projects`
--

DROP TABLE IF EXISTS `contestant_work_projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contestant_work_projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `contest_id` int(11) DEFAULT NULL,
  `work_id` int(11) DEFAULT NULL,
  `contestant_work_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `is_leader` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contestant_work_projects_on_contest_id` (`contest_id`),
  KEY `index_contestant_work_projects_on_work_id` (`work_id`),
  KEY `index_contestant_work_projects_on_contestant_work_id` (`contestant_work_id`),
  KEY `index_contestant_work_projects_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contestant_work_scores`
--

DROP TABLE IF EXISTS `contestant_work_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contestant_work_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `contestant_work_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `score` int(11) DEFAULT NULL,
  `comment` text,
  `reviewer_role` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contestant_work_scores_on_contestant_work_id` (`contestant_work_id`),
  KEY `index_contestant_work_scores_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contestant_works`
--

DROP TABLE IF EXISTS `contestant_works`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contestant_works` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `work_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `work_score` float DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `work_status` int(11) DEFAULT NULL,
  `commit_time` datetime DEFAULT NULL,
  `is_delete` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `judge_score` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_contestant_works_on_work_id` (`work_id`),
  KEY `index_contestant_works_on_user_id` (`user_id`),
  KEY `index_contestant_works_on_project_id` (`project_id`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `contests`
--

DROP TABLE IF EXISTS `contests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `is_public` tinyint(1) DEFAULT NULL,
  `is_delete` tinyint(1) DEFAULT '0',
  `visits` int(11) DEFAULT '0',
  `invite_code` varchar(255) DEFAULT NULL,
  `invite_code_halt` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=810 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `coo_imgs`
--

DROP TABLE IF EXISTS `coo_imgs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coo_imgs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `src_states` varchar(255) DEFAULT NULL,
  `url_states` varchar(255) DEFAULT NULL,
  `img_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `position` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `coop_imgs`
--

DROP TABLE IF EXISTS `coop_imgs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coop_imgs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `src_states` varchar(255) DEFAULT NULL,
  `url_states` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `img_type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cooperations`
--

DROP TABLE IF EXISTS `cooperations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cooperations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `mail` varchar(255) DEFAULT NULL,
  `qq` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `user_type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_activities`
--

DROP TABLE IF EXISTS `course_activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `course_act_id` int(11) DEFAULT NULL,
  `course_act_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `course_act_index` (`course_id`,`course_act_id`,`course_act_type`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=56448 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_attachments`
--

DROP TABLE IF EXISTS `course_attachments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_attachments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `filename` varchar(255) DEFAULT NULL,
  `disk_filename` varchar(255) DEFAULT NULL,
  `filesize` int(11) DEFAULT NULL,
  `content_type` varchar(255) DEFAULT NULL,
  `digest` varchar(255) DEFAULT NULL,
  `downloads` int(11) DEFAULT NULL,
  `author_id` varchar(255) DEFAULT NULL,
  `integer` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `disk_directory` varchar(255) DEFAULT NULL,
  `attachtype` int(11) DEFAULT NULL,
  `is_public` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `container_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=413 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_contributor_scores`
--

DROP TABLE IF EXISTS `course_contributor_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_contributor_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `message_num` int(11) DEFAULT '0',
  `message_reply_num` int(11) DEFAULT '0',
  `news_reply_num` int(11) DEFAULT '0',
  `resource_num` int(11) DEFAULT '0',
  `journal_num` int(11) DEFAULT '0',
  `journal_reply_num` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `total_score` int(11) DEFAULT '0',
  `homework_journal_num` int(11) DEFAULT '0',
  `news_num` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_course_contributor_scores_on_course_id_and_user_id` (`course_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=38713 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_groups`
--

DROP TABLE IF EXISTS `course_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `members_count` int(11) DEFAULT NULL,
  `invite_code` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT '0',
  `course_members_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_course_groups_on_invite_code` (`invite_code`),
  KEY `index_course_groups_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2414 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_homework_categories`
--

DROP TABLE IF EXISTS `course_homework_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_homework_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_course_homework_categories_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=415 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_homework_statistics`
--

DROP TABLE IF EXISTS `course_homework_statistics`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_homework_statistics` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `committed_work_num` int(11) DEFAULT '0',
  `un_commit_work_num` int(11) DEFAULT '0',
  `late_commit_work_num` int(11) DEFAULT '0',
  `absence_evaluation_work_num` int(11) DEFAULT '0',
  `un_evaluation_work_num` int(11) DEFAULT '0',
  `appeal_num` int(11) DEFAULT '0',
  `average_score` float DEFAULT '0',
  `total_score` float DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=31032 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_infos`
--

DROP TABLE IF EXISTS `course_infos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_infos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2984 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_lists`
--

DROP TABLE IF EXISTS `course_lists`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_lists` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `is_admin` tinyint(1) DEFAULT '1',
  `support_shixuns_search` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1840 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_members`
--

DROP TABLE IF EXISTS `course_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_members` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `course_group_id` int(11) DEFAULT '0',
  `graduation_group_id` int(11) DEFAULT '0',
  `role` int(11) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_course_id_user_id_role` (`course_id`,`user_id`,`role`),
  KEY `index_course_members_on_course_group_id` (`course_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=110298 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_messages`
--

DROP TABLE IF EXISTS `course_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `course_message_id` int(11) DEFAULT NULL,
  `course_message_type` varchar(255) DEFAULT NULL,
  `viewed` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `content` text,
  `status` int(11) DEFAULT NULL,
  `apply_user_id` int(11) DEFAULT NULL,
  `apply_result` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_course_messages_on_user_id_and_course_id_and_created_at` (`user_id`,`course_id`,`created_at`),
  KEY `index_course_messages_on_course_message_type` (`course_message_type`)
) ENGINE=InnoDB AUTO_INCREMENT=1033806 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_modules`
--

DROP TABLE IF EXISTS `course_modules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_modules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `module_type` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `hidden` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `module_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_course_modules_on_course_id_and_module_type` (`course_id`,`module_type`)
) ENGINE=InnoDB AUTO_INCREMENT=30297 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_second_categories`
--

DROP TABLE IF EXISTS `course_second_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_second_categories` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) DEFAULT NULL,
  `category_type` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `course_module_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_course_second_categories_on_course_id` (`course_id`),
  KEY `index_course_second_categories_on_course_module_id` (`course_module_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1624 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `course_statuses`
--

DROP TABLE IF EXISTS `course_statuses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_statuses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `changesets_count` int(11) DEFAULT NULL,
  `watchers_count` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `grade` float DEFAULT '0',
  `course_ac_para` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=940 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `courses`
--

DROP TABLE IF EXISTS `courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tea_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `state` int(11) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `time` int(11) DEFAULT NULL,
  `extra` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `location` varchar(255) DEFAULT NULL,
  `term` varchar(255) DEFAULT NULL,
  `string` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `setup_time` varchar(255) DEFAULT NULL,
  `endup_time` varchar(255) DEFAULT NULL,
  `class_period` int(11) DEFAULT '0',
  `school_id` int(11) DEFAULT NULL,
  `description` text,
  `status` int(11) DEFAULT '1',
  `attachmenttype` int(11) DEFAULT '2',
  `lft` int(11) DEFAULT NULL,
  `rgt` int(11) DEFAULT NULL,
  `is_public` tinyint(4) DEFAULT '1',
  `inherit_members` tinyint(4) DEFAULT '1',
  `open_student` int(11) DEFAULT '0',
  `outline` int(11) DEFAULT '0',
  `publish_resource` int(11) DEFAULT '0',
  `is_delete` int(11) DEFAULT '0',
  `end_time` int(11) DEFAULT NULL,
  `end_term` varchar(255) DEFAULT NULL,
  `is_excellent` int(11) DEFAULT '0',
  `excellent_option` int(11) DEFAULT '0',
  `is_copy` int(11) DEFAULT '0',
  `visits` int(11) DEFAULT '0',
  `syllabus_id` int(11) DEFAULT NULL,
  `invite_code` varchar(255) DEFAULT NULL,
  `qrcode` varchar(255) DEFAULT NULL,
  `qrcode_expiretime` int(11) DEFAULT '0',
  `invite_code_halt` tinyint(4) DEFAULT '0',
  `os_allow` int(11) DEFAULT '0',
  `credit` float DEFAULT NULL,
  `is_end` tinyint(1) DEFAULT '0',
  `end_date` date DEFAULT NULL,
  `choose_group_allow` tinyint(1) DEFAULT '0',
  `homepage_show` tinyint(1) DEFAULT '0',
  `course_list_id` int(11) DEFAULT NULL,
  `members_count` int(11) DEFAULT '0',
  `homework_commons_count` int(11) DEFAULT '0',
  `show_unit` tinyint(1) DEFAULT '0',
  `teacher_list` varchar(255) DEFAULT '老师',
  `student_list` varchar(255) DEFAULT '学生',
  `is_hidden` tinyint(1) DEFAULT '0',
  `course_members_count` int(11) DEFAULT '0',
  `course_groups_count` int(11) DEFAULT '0',
  `authentication` tinyint(1) DEFAULT '0',
  `professional_certification` tinyint(1) DEFAULT '0',
  `graduation_topics_count` int(11) DEFAULT '0',
  `graduation_tasks_count` int(11) DEFAULT '0',
  `polls_count` int(11) DEFAULT '0',
  `exercises_count` int(11) DEFAULT '0',
  `start_date` date DEFAULT NULL,
  `subject_id` int(11) DEFAULT '0',
  `excellent` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_courses_on_invite_code` (`invite_code`),
  KEY `index_courses_on_school_id_and_is_delete` (`school_id`,`is_delete`),
  KEY `index_courses_on_tea_id` (`tea_id`),
  KEY `index_courses_on_subject_id` (`subject_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3046 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `custom_fields`
--

DROP TABLE IF EXISTS `custom_fields`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `custom_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(30) NOT NULL DEFAULT '',
  `name` varchar(30) NOT NULL DEFAULT '',
  `field_format` varchar(30) NOT NULL DEFAULT '',
  `possible_values` text,
  `regexp` varchar(255) DEFAULT '',
  `min_length` int(11) NOT NULL DEFAULT '0',
  `max_length` int(11) NOT NULL DEFAULT '0',
  `is_required` tinyint(1) NOT NULL DEFAULT '0',
  `is_for_all` tinyint(1) NOT NULL DEFAULT '0',
  `is_filter` tinyint(1) NOT NULL DEFAULT '0',
  `position` int(11) DEFAULT '1',
  `searchable` tinyint(1) DEFAULT '0',
  `default_value` text,
  `editable` tinyint(1) DEFAULT '1',
  `visible` tinyint(1) NOT NULL DEFAULT '1',
  `multiple` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_custom_fields_on_id_and_type` (`id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `custom_fields_projects`
--

DROP TABLE IF EXISTS `custom_fields_projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `custom_fields_projects` (
  `custom_field_id` int(11) NOT NULL DEFAULT '0',
  `project_id` int(11) NOT NULL DEFAULT '0',
  UNIQUE KEY `index_custom_fields_projects_on_custom_field_id_and_project_id` (`custom_field_id`,`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `custom_fields_trackers`
--

DROP TABLE IF EXISTS `custom_fields_trackers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `custom_fields_trackers` (
  `custom_field_id` int(11) NOT NULL DEFAULT '0',
  `tracker_id` int(11) NOT NULL DEFAULT '0',
  UNIQUE KEY `index_custom_fields_trackers_on_custom_field_id_and_tracker_id` (`custom_field_id`,`tracker_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `custom_values`
--

DROP TABLE IF EXISTS `custom_values`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `custom_values` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `customized_type` varchar(30) NOT NULL DEFAULT '',
  `customized_id` int(11) NOT NULL DEFAULT '0',
  `custom_field_id` int(11) NOT NULL DEFAULT '0',
  `value` text,
  PRIMARY KEY (`id`),
  KEY `custom_values_customized` (`customized_type`,`customized_id`),
  KEY `index_custom_values_on_custom_field_id` (`custom_field_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `partner_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `school_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_customers_on_partner_id` (`partner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `data_exceptions`
--

DROP TABLE IF EXISTS `data_exceptions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `data_exceptions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `message` varchar(255) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `delayed_jobs`
--

DROP TABLE IF EXISTS `delayed_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `delayed_jobs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `priority` int(11) NOT NULL DEFAULT '0',
  `attempts` int(11) NOT NULL DEFAULT '0',
  `handler` text NOT NULL,
  `last_error` text,
  `run_at` datetime DEFAULT NULL,
  `locked_at` datetime DEFAULT NULL,
  `failed_at` datetime DEFAULT NULL,
  `locked_by` varchar(255) DEFAULT NULL,
  `queue` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `delayed_jobs_priority` (`priority`,`run_at`)
) ENGINE=InnoDB AUTO_INCREMENT=13817 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `delayed_jobs_20161218`
--

DROP TABLE IF EXISTS `delayed_jobs_20161218`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `delayed_jobs_20161218` (
  `id` int(11) NOT NULL DEFAULT '0',
  `priority` int(11) NOT NULL DEFAULT '0',
  `attempts` int(11) NOT NULL DEFAULT '0',
  `handler` text NOT NULL,
  `last_error` text,
  `run_at` datetime DEFAULT NULL,
  `locked_at` datetime DEFAULT NULL,
  `failed_at` datetime DEFAULT NULL,
  `locked_by` varchar(255) DEFAULT NULL,
  `queue` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `department_members`
--

DROP TABLE IF EXISTS `department_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `department_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `department_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_department_members_on_department_id` (`department_id`),
  KEY `index_department_members_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `departments`
--

DROP TABLE IF EXISTS `departments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `departments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `is_auth` tinyint(1) DEFAULT '0',
  `identifier` varchar(255) DEFAULT NULL,
  `host_count` int(11) DEFAULT '5',
  `is_delete` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_departments_on_school_id` (`school_id`)
) ENGINE=InnoDB AUTO_INCREMENT=31728 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `discipline_categories`
--

DROP TABLE IF EXISTS `discipline_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `discipline_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `major_level` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `discuss_demos`
--

DROP TABLE IF EXISTS `discuss_demos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `discuss_demos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `body` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `discusses`
--

DROP TABLE IF EXISTS `discusses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `discusses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `dis_type` varchar(255) DEFAULT NULL,
  `dis_id` int(11) DEFAULT NULL,
  `content` text,
  `parent_id` int(11) DEFAULT NULL,
  `root_id` int(11) DEFAULT NULL,
  `praise_count` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `challenge_id` int(11) DEFAULT NULL,
  `reward` int(11) DEFAULT NULL,
  `hidden` tinyint(1) DEFAULT '1',
  `last_reply_id` int(11) DEFAULT NULL,
  `position` tinyint(4) DEFAULT NULL,
  `praises_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_discusses_on_user_id` (`user_id`),
  KEY `index_discusses_on_challenge_id` (`challenge_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15232 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `documents`
--

DROP TABLE IF EXISTS `documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `category_id` int(11) NOT NULL DEFAULT '0',
  `title` varchar(60) NOT NULL DEFAULT '',
  `description` text,
  `created_on` datetime DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `is_public` int(11) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `documents_project_id` (`project_id`),
  KEY `index_documents_on_category_id` (`category_id`),
  KEY `index_documents_on_created_on` (`created_on`)
) ENGINE=InnoDB AUTO_INCREMENT=222 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dts`
--

DROP TABLE IF EXISTS `dts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dts` (
  `Num` int(11) NOT NULL DEFAULT '0',
  `Defect` varchar(50) DEFAULT NULL,
  `Category` varchar(50) DEFAULT NULL,
  `File` varchar(255) DEFAULT NULL,
  `Method` varchar(255) DEFAULT NULL,
  `Module` varchar(20) DEFAULT NULL,
  `Variable` varchar(50) DEFAULT NULL,
  `StartLine` int(11) DEFAULT NULL,
  `IPLine` int(11) DEFAULT NULL,
  `IPLineCode` varchar(200) DEFAULT NULL,
  `Judge` varchar(15) DEFAULT NULL,
  `Review` tinyint(4) DEFAULT NULL,
  `Description` varchar(255) DEFAULT NULL,
  `PreConditions` longtext,
  `TraceInfo` longtext,
  `Code` longtext,
  `project_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `id` int(11) NOT NULL,
  PRIMARY KEY (`Num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_achievement_evaluation_relates`
--

DROP TABLE IF EXISTS `ec_achievement_evaluation_relates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_achievement_evaluation_relates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_course_achievement_method_id` int(11) DEFAULT NULL,
  `ec_course_evaluation_subitem_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `position` int(11) DEFAULT NULL,
  `ec_course_target_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2668 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_course_achievement_methods`
--

DROP TABLE IF EXISTS `ec_course_achievement_methods`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_course_achievement_methods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_course_id` int(11) DEFAULT NULL,
  `ec_course_evaluation_id` int(11) DEFAULT NULL,
  `ec_course_evaluation_subitem_id` int(11) DEFAULT NULL,
  `score` int(11) DEFAULT NULL,
  `percentage` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ec_course_target_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2282 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_course_evaluation_subitems`
--

DROP TABLE IF EXISTS `ec_course_evaluation_subitems`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_course_evaluation_subitems` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `ec_course_evaluation_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3050 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_course_evaluations`
--

DROP TABLE IF EXISTS `ec_course_evaluations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_course_evaluations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `evluation_count` int(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL,
  `ec_course_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `is_course_type` tinyint(1) DEFAULT '0',
  `import_status` tinyint(1) DEFAULT '0',
  `score_type` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=919 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_course_student_scores`
--

DROP TABLE IF EXISTS `ec_course_student_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_course_student_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_course_id` int(11) DEFAULT NULL,
  `student_number` varchar(255) DEFAULT NULL,
  `student_name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ec_year_student_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_ec_course_scores_on_ec_year_student_id` (`ec_year_student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17692 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_course_supports`
--

DROP TABLE IF EXISTS `ec_course_supports`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_course_supports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weigths` float DEFAULT NULL,
  `top_relation` tinyint(1) DEFAULT NULL,
  `position` tinyint(4) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ec_course_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4034 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_course_targets`
--

DROP TABLE IF EXISTS `ec_course_targets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_course_targets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content` text,
  `standard_grade` int(11) DEFAULT '75',
  `weigths` float DEFAULT NULL,
  `position` tinyint(4) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ec_course_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5080 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_course_users`
--

DROP TABLE IF EXISTS `ec_course_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_course_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_course_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `ec_year_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_ec_course_users_on_ec_course_id` (`ec_course_id`),
  KEY `index_ec_course_users_on_user_id` (`user_id`),
  KEY `index_ec_course_users_on_ec_year_id` (`ec_year_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_courses`
--

DROP TABLE IF EXISTS `ec_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ec_year_id` int(11) DEFAULT NULL,
  `complete_target_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2539 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_discipline_firsts`
--

DROP TABLE IF EXISTS `ec_discipline_firsts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_discipline_firsts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `ec_discipline_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_disciplines`
--

DROP TABLE IF EXISTS `ec_disciplines`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_disciplines` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_graduation_requirement_calculations`
--

DROP TABLE IF EXISTS `ec_graduation_requirement_calculations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_graduation_requirement_calculations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_course_support_id` int(11) DEFAULT NULL,
  `target_value` float DEFAULT '0',
  `real_value` float DEFAULT '0',
  `status` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=252 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_graduation_requirements`
--

DROP TABLE IF EXISTS `ec_graduation_requirements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_graduation_requirements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content` text,
  `ec_year_id` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=540 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_graduation_standards`
--

DROP TABLE IF EXISTS `ec_graduation_standards`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_graduation_standards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_graduation_subitem_course_targets`
--

DROP TABLE IF EXISTS `ec_graduation_subitem_course_targets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_graduation_subitem_course_targets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_graduation_subitem_id` int(11) DEFAULT NULL,
  `ec_course_target_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5130 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_graduation_subitem_courses`
--

DROP TABLE IF EXISTS `ec_graduation_subitem_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_graduation_subitem_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_graduation_subitem_id` int(11) DEFAULT NULL,
  `ec_course_support_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3461 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_graduation_subitems`
--

DROP TABLE IF EXISTS `ec_graduation_subitems`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_graduation_subitems` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content` text,
  `ec_graduation_requirement_id` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1271 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_major_courses`
--

DROP TABLE IF EXISTS `ec_major_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_major_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `ec_course_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_major_school_users`
--

DROP TABLE IF EXISTS `ec_major_school_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_major_school_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_major_school_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_major_schools`
--

DROP TABLE IF EXISTS `ec_major_schools`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_major_schools` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_major_id` int(11) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `template_major` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_majors`
--

DROP TABLE IF EXISTS `ec_majors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_majors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `ec_discipline_first_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=507 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_require_sub_vs_standards`
--

DROP TABLE IF EXISTS `ec_require_sub_vs_standards`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_require_sub_vs_standards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_graduation_subitem_id` int(11) DEFAULT NULL,
  `ec_graduation_standard_id` int(11) DEFAULT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3521 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_requirement_vs_objectives`
--

DROP TABLE IF EXISTS `ec_requirement_vs_objectives`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_requirement_vs_objectives` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_graduation_requirement_id` int(11) DEFAULT NULL,
  `ec_training_objective_id` int(11) DEFAULT NULL,
  `status` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1453 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_school_users`
--

DROP TABLE IF EXISTS `ec_school_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_school_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_score_levels`
--

DROP TABLE IF EXISTS `ec_score_levels`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_score_levels` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `score` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `level` varchar(255) DEFAULT NULL,
  `ec_course_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_student_achievements`
--

DROP TABLE IF EXISTS `ec_student_achievements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_student_achievements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_course_evaluation_subitem_id` int(11) DEFAULT NULL,
  `student_number` varchar(255) DEFAULT NULL,
  `student_name` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `score` float DEFAULT '0',
  `ec_course_evaluation_id` int(11) DEFAULT NULL,
  `ec_year_student_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_ec_student_achievements_on_ec_course_evaluation_subitem_id` (`ec_course_evaluation_subitem_id`),
  KEY `index_ec_student_achievements_on_ec_course_evaluation_id` (`ec_course_evaluation_id`),
  KEY `index_ec_student_achievements_on_ec_year_student_id` (`ec_year_student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=90654 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_student_score_targets`
--

DROP TABLE IF EXISTS `ec_student_score_targets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_student_score_targets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_course_id` int(11) DEFAULT NULL,
  `ec_course_student_score_id` int(11) DEFAULT NULL,
  `ec_course_target_id` int(11) DEFAULT NULL,
  `ec_target_position` int(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `eaer_id` int(11) DEFAULT NULL,
  `ec_year_student_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_ec_student_targets_on_ec_year_student_id` (`ec_year_student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=69046 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_templates`
--

DROP TABLE IF EXISTS `ec_templates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_templates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_training_objectives`
--

DROP TABLE IF EXISTS `ec_training_objectives`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_training_objectives` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content` text,
  `ec_year_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_training_subitems`
--

DROP TABLE IF EXISTS `ec_training_subitems`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_training_subitems` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content` text,
  `ec_training_objective_id` int(11) DEFAULT NULL,
  `position` tinyint(4) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=288 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_year_students`
--

DROP TABLE IF EXISTS `ec_year_students`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_year_students` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ec_year_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `student_id` varchar(255) DEFAULT NULL,
  `guarantee_school` varchar(255) DEFAULT NULL,
  `guarantee_major` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_ec_year_students_on_ec_year_id` (`ec_year_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1359 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ec_years`
--

DROP TABLE IF EXISTS `ec_years`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ec_years` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `year` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ec_major_school_id` int(11) DEFAULT NULL,
  `calculation_value` float DEFAULT '0.7',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ecloud_logs`
--

DROP TABLE IF EXISTS `ecloud_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecloud_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `url` varchar(255) DEFAULT NULL,
  `applyno` varchar(255) DEFAULT NULL,
  `custid` int(11) DEFAULT NULL,
  `custcode` varchar(255) DEFAULT NULL,
  `para_value` longtext,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `userid` int(11) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ecloud_productparas`
--

DROP TABLE IF EXISTS `ecloud_productparas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecloud_productparas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `key` varchar(255) DEFAULT NULL,
  `value` varchar(255) DEFAULT NULL,
  `ecloud_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ecloud_services`
--

DROP TABLE IF EXISTS `ecloud_services`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecloud_services` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `opttype` int(11) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `begintime` bigint(20) DEFAULT NULL,
  `endtime` bigint(20) DEFAULT NULL,
  `ecloud_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `packagecode` varchar(255) DEFAULT NULL,
  `bossorderid` varchar(255) DEFAULT NULL,
  `productcode` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ecloud_serviece_serviceparas`
--

DROP TABLE IF EXISTS `ecloud_serviece_serviceparas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecloud_serviece_serviceparas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `key` varchar(255) DEFAULT NULL,
  `value` varchar(255) DEFAULT NULL,
  `ecloud_service_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ecloud_user_paras`
--

DROP TABLE IF EXISTS `ecloud_user_paras`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecloud_user_paras` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `key` varchar(255) DEFAULT NULL,
  `value` varchar(255) DEFAULT NULL,
  `ecloud_user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ecloud_users`
--

DROP TABLE IF EXISTS `ecloud_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecloud_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `opttype` int(11) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `useralias` varchar(255) DEFAULT NULL,
  `mobile` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `begintime` bigint(20) DEFAULT NULL,
  `endtime` bigint(20) DEFAULT NULL,
  `paras` varchar(255) DEFAULT NULL,
  `custid` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ecloud_id` int(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL,
  `operatime` bigint(20) DEFAULT NULL,
  `effecttime` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eclouds`
--

DROP TABLE IF EXISTS `eclouds`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eclouds` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `applyno` varchar(255) DEFAULT NULL,
  `ecordercode` varchar(255) DEFAULT NULL,
  `opttype` int(11) DEFAULT NULL,
  `trial` tinyint(1) DEFAULT NULL,
  `bossorderid` varchar(255) DEFAULT NULL,
  `custid` int(11) DEFAULT NULL,
  `custcode` varchar(255) DEFAULT NULL,
  `registersource` int(11) DEFAULT NULL,
  `custtype` int(11) DEFAULT NULL,
  `custname` varchar(255) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `useralias` varchar(255) DEFAULT NULL,
  `mobile` varchar(255) DEFAULT NULL,
  `productcode` varchar(255) DEFAULT NULL,
  `begintime` bigint(20) DEFAULT NULL,
  `endtime` bigint(20) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `operatime` bigint(20) DEFAULT NULL,
  `effecttime` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ecloudusers`
--

DROP TABLE IF EXISTS `ecloudusers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ecloudusers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `applyno` varchar(255) DEFAULT NULL,
  `ecordercoder` varchar(255) DEFAULT NULL,
  `string` varchar(255) DEFAULT NULL,
  `opttype` int(11) DEFAULT NULL,
  `trial` tinyint(1) DEFAULT NULL,
  `bossorderid` varchar(255) DEFAULT NULL,
  `custid` int(11) DEFAULT NULL,
  `custcod` varchar(255) DEFAULT NULL,
  `custtype` int(11) DEFAULT NULL,
  `registersource` int(11) DEFAULT NULL,
  `custname` varchar(255) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `useralias` varchar(255) DEFAULT NULL,
  `moblile` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `productcode` varchar(255) DEFAULT NULL,
  `begintime` datetime DEFAULT NULL,
  `endtime` datetime DEFAULT NULL,
  `productparas` varchar(255) DEFAULT NULL,
  `services` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `editor_of_documents`
--

DROP TABLE IF EXISTS `editor_of_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `editor_of_documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `editor_id` int(11) DEFAULT NULL,
  `org_document_comment_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1663 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `edu_settings`
--

DROP TABLE IF EXISTS `edu_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `edu_settings` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `value` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_edu_settings_on_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `enabled_modules`
--

DROP TABLE IF EXISTS `enabled_modules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `enabled_modules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `course_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `enabled_modules_project_id` (`project_id`)
) ENGINE=InnoDB AUTO_INCREMENT=43627 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `enumerations`
--

DROP TABLE IF EXISTS `enumerations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `enumerations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL DEFAULT '',
  `position` int(11) DEFAULT '1',
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `type` varchar(255) DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `project_id` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `position_name` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_enumerations_on_project_id` (`project_id`),
  KEY `index_enumerations_on_id_and_type` (`id`,`type`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `error_checks`
--

DROP TABLE IF EXISTS `error_checks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `error_checks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `game_indentifier` varchar(255) DEFAULT NULL,
  `login` varchar(255) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=864 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `evaluate_records`
--

DROP TABLE IF EXISTS `evaluate_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `evaluate_records` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `game_id` int(11) DEFAULT NULL,
  `consume_time` float DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `file_update` float DEFAULT NULL,
  `git_pull` float DEFAULT NULL,
  `create_pod` float DEFAULT NULL,
  `pod_execute` float DEFAULT NULL,
  `student_work` float DEFAULT NULL,
  `test_cases` float DEFAULT NULL,
  `retry` float DEFAULT NULL,
  `game_build` float DEFAULT NULL,
  `return_back` float DEFAULT NULL,
  `brige` float DEFAULT NULL,
  `create_status` datetime DEFAULT NULL,
  `front_js` float DEFAULT NULL,
  `identifier` varchar(255) DEFAULT NULL,
  `max_mem` float DEFAULT NULL,
  `exec_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_evaluate_records_on_identifier` (`identifier`),
  KEY `index_evaluate_records_on_game_id` (`game_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1287169 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `evaluate_records201905`
--

DROP TABLE IF EXISTS `evaluate_records201905`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `evaluate_records201905` (
  `id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `game_id` int(11) DEFAULT NULL,
  `consume_time` float DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `file_update` float DEFAULT NULL,
  `git_pull` float DEFAULT NULL,
  `create_pod` float DEFAULT NULL,
  `pod_execute` float DEFAULT NULL,
  `student_work` float DEFAULT NULL,
  `test_cases` float DEFAULT NULL,
  `retry` float DEFAULT NULL,
  `game_build` float DEFAULT NULL,
  `return_back` float DEFAULT NULL,
  `brige` float DEFAULT NULL,
  `create_status` datetime DEFAULT NULL,
  `front_js` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `evaluate_records_20181022`
--

DROP TABLE IF EXISTS `evaluate_records_20181022`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `evaluate_records_20181022` (
  `id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `game_id` int(11) DEFAULT NULL,
  `consume_time` float DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `file_update` float DEFAULT NULL,
  `git_pull` float DEFAULT NULL,
  `create_pod` float DEFAULT NULL,
  `pod_execute` float DEFAULT NULL,
  `student_work` float DEFAULT NULL,
  `test_cases` float DEFAULT NULL,
  `retry` float DEFAULT NULL,
  `game_build` float DEFAULT NULL,
  `return_back` float DEFAULT NULL,
  `brige` float DEFAULT NULL,
  `create_status` datetime DEFAULT NULL,
  `front_js` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_answer_comments`
--

DROP TABLE IF EXISTS `exercise_answer_comments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_answer_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_answer_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `exercise_question_id` int(11) DEFAULT NULL,
  `comment` text,
  `score` decimal(10,1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `exercise_shixun_answer_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_answer_comments_on_exercise_answer_id` (`exercise_answer_id`),
  KEY `index_exercise_answer_comments_on_user_id` (`user_id`),
  KEY `index_exercise_answer_comments_on_exercise_question_id` (`exercise_question_id`),
  KEY `exercise_shixun_answer_comment_id` (`exercise_shixun_answer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7181 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_answers`
--

DROP TABLE IF EXISTS `exercise_answers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_answers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `exercise_question_id` int(11) DEFAULT NULL,
  `exercise_choice_id` int(11) DEFAULT NULL,
  `answer_text` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `score` decimal(10,1) DEFAULT '-1.0',
  PRIMARY KEY (`id`),
  KEY `index_exercise_answers_on_exercise_question_id_and_user_id` (`exercise_question_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1502180 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_bank_choices`
--

DROP TABLE IF EXISTS `exercise_bank_choices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_bank_choices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_bank_question_id` int(11) DEFAULT NULL,
  `choice_text` text,
  `choice_position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_bank_choices_on_exercise_bank_question_id` (`exercise_bank_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=32970 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_bank_questions`
--

DROP TABLE IF EXISTS `exercise_bank_questions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_bank_questions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question_title` text,
  `question_type` int(11) DEFAULT NULL,
  `question_number` int(11) DEFAULT NULL,
  `question_score` decimal(10,1) DEFAULT NULL,
  `exercise_bank_id` int(11) DEFAULT NULL,
  `max_choices` int(11) DEFAULT NULL,
  `min_choices` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `is_necessary` int(11) DEFAULT '1',
  `shixun_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_bank_questions_on_exercise_bank_id` (`exercise_bank_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10221 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_bank_questions_backup`
--

DROP TABLE IF EXISTS `exercise_bank_questions_backup`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_bank_questions_backup` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question_title` text,
  `question_type` int(11) DEFAULT NULL,
  `question_number` int(11) DEFAULT NULL,
  `question_score` decimal(10,1) DEFAULT NULL,
  `exercise_bank_id` int(11) DEFAULT NULL,
  `max_choices` int(11) DEFAULT NULL,
  `min_choices` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `is_necessary` int(11) DEFAULT '1',
  `shixun_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_bank_questions_on_exercise_bank_id` (`exercise_bank_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10157 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_bank_shixun_challenges`
--

DROP TABLE IF EXISTS `exercise_bank_shixun_challenges`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_bank_shixun_challenges` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `challenge_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `exercise_bank_question_id` int(11) DEFAULT NULL,
  `question_score` decimal(10,1) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_bank_shixun_challenges_on_challenge_id` (`challenge_id`),
  KEY `index_exercise_bank_shixun_challenges_on_shixun_id` (`shixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=138 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_bank_standard_answers`
--

DROP TABLE IF EXISTS `exercise_bank_standard_answers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_bank_standard_answers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_bank_question_id` int(11) DEFAULT NULL,
  `exercise_bank_choice_id` int(11) DEFAULT NULL,
  `answer_text` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9834 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_bank_standard_answers_backup`
--

DROP TABLE IF EXISTS `exercise_bank_standard_answers_backup`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_bank_standard_answers_backup` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_bank_question_id` int(11) DEFAULT NULL,
  `exercise_bank_choice_id` int(11) DEFAULT NULL,
  `answer_text` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9802 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_banks`
--

DROP TABLE IF EXISTS `exercise_banks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_banks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `user_id` int(11) DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT NULL,
  `quotes` int(11) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `course_list_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_banks_on_user_id` (`user_id`),
  KEY `index_exercise_banks_on_course_list_id` (`course_list_id`)
) ENGINE=InnoDB AUTO_INCREMENT=771 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_choices`
--

DROP TABLE IF EXISTS `exercise_choices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_choices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_question_id` int(11) DEFAULT NULL,
  `choice_text` text,
  `choice_position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_choices_on_exercise_question_id` (`exercise_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=84588 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_group_settings`
--

DROP TABLE IF EXISTS `exercise_group_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_group_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_id` int(11) DEFAULT NULL,
  `course_group_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `publish_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_group_settings_on_exercise_id` (`exercise_id`),
  KEY `index_exercise_group_settings_on_course_group_id` (`course_group_id`),
  KEY `index_exercise_group_settings_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=273 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_questions`
--

DROP TABLE IF EXISTS `exercise_questions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_questions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question_title` text,
  `question_type` int(11) DEFAULT NULL,
  `question_number` int(11) DEFAULT NULL,
  `exercise_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `question_score` decimal(10,1) DEFAULT '0.0',
  `shixun_id` int(11) DEFAULT NULL,
  `shixun_name` varchar(255) DEFAULT NULL,
  `is_ordered` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `index_exercise_questions_on_exercise_id` (`exercise_id`)
) ENGINE=InnoDB AUTO_INCREMENT=26837 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_questions_backup`
--

DROP TABLE IF EXISTS `exercise_questions_backup`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_questions_backup` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question_title` text,
  `question_type` int(11) DEFAULT NULL,
  `question_number` int(11) DEFAULT NULL,
  `exercise_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `question_score` decimal(10,1) DEFAULT '0.0',
  `shixun_id` int(11) DEFAULT NULL,
  `shixun_name` varchar(255) DEFAULT NULL,
  `is_ordered` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `index_exercise_questions_on_exercise_id` (`exercise_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25572 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_shixun_answers`
--

DROP TABLE IF EXISTS `exercise_shixun_answers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_shixun_answers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_question_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `exercise_shixun_challenge_id` int(11) DEFAULT NULL,
  `answer_text` text,
  `score` decimal(10,1) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_user_id_and_exercise_shixun_challenge_id` (`user_id`,`exercise_shixun_challenge_id`),
  KEY `exercise_question_id_user_id` (`exercise_question_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=28754 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_shixun_challenges`
--

DROP TABLE IF EXISTS `exercise_shixun_challenges`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_shixun_challenges` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `challenge_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `exercise_question_id` int(11) DEFAULT NULL,
  `question_score` decimal(10,1) DEFAULT '0.0',
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_shixun_challenges_on_challenge_id` (`challenge_id`),
  KEY `index_exercise_shixun_challenges_on_exercise_question_id` (`exercise_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1038 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_standard_answers`
--

DROP TABLE IF EXISTS `exercise_standard_answers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_standard_answers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_question_id` int(11) DEFAULT NULL,
  `exercise_choice_id` int(11) DEFAULT NULL,
  `answer_text` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_exercise_standard_answers_on_exercise_question_id` (`exercise_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29645 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercise_users`
--

DROP TABLE IF EXISTS `exercise_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercise_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `exercise_id` int(11) DEFAULT NULL,
  `score` decimal(10,1) DEFAULT NULL,
  `start_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `end_at` datetime DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `commit_status` int(11) DEFAULT '0',
  `objective_score` decimal(10,1) DEFAULT '0.0',
  `subjective_score` decimal(10,1) DEFAULT '-1.0',
  `is_delete` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_on_exercise_id_user_id` (`exercise_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=218570 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `exercises`
--

DROP TABLE IF EXISTS `exercises`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `exercises` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exercise_name` text,
  `exercise_description` text,
  `course_id` int(11) DEFAULT NULL,
  `exercise_status` int(11) DEFAULT '1',
  `user_id` int(11) DEFAULT NULL,
  `time` int(11) DEFAULT '-1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `publish_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `show_result` int(11) DEFAULT '1',
  `question_random` tinyint(1) DEFAULT '1',
  `choice_random` tinyint(1) DEFAULT '1',
  `is_public` tinyint(1) DEFAULT '0',
  `score_open` tinyint(1) DEFAULT '1',
  `answer_open` tinyint(1) DEFAULT '1',
  `exercise_bank_id` int(11) DEFAULT NULL,
  `unified_setting` tinyint(1) DEFAULT '1',
  `show_statistic` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_exercises_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2014 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `experiences`
--

DROP TABLE IF EXISTS `experiences`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `experiences` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `score` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `exper` (`container_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1626200 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `first_level_disciplines`
--

DROP TABLE IF EXISTS `first_level_disciplines`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `first_level_disciplines` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `discipline_category_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_first_level_disciplines_on_discipline_category_id` (`discipline_category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=312 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `first_pages`
--

DROP TABLE IF EXISTS `first_pages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `first_pages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `web_title` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `description` text,
  `page_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `sort_type` int(11) DEFAULT NULL,
  `image_width` int(11) DEFAULT '107',
  `image_height` int(11) DEFAULT '63',
  `show_course` int(11) DEFAULT '1',
  `show_contest` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `forge_activities`
--

DROP TABLE IF EXISTS `forge_activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `forge_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `forge_act_id` int(11) DEFAULT NULL,
  `forge_act_type` varchar(255) DEFAULT NULL,
  `org_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_forge_activities_on_forge_act_id` (`forge_act_id`),
  KEY `forge_act_index` (`project_id`,`forge_act_id`,`created_at`,`forge_act_type`)
) ENGINE=InnoDB AUTO_INCREMENT=35303 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `forge_messages`
--

DROP TABLE IF EXISTS `forge_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `forge_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `forge_message_id` int(11) DEFAULT NULL,
  `forge_message_type` varchar(255) DEFAULT NULL,
  `viewed` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `secret_key` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `operate_user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_forge_messages_on_user_id_and_project_id_and_created_at` (`user_id`,`project_id`,`created_at`),
  KEY `index_forge_messages_on_forge_message_id_and_forge_message_type` (`forge_message_id`,`forge_message_type`)
) ENGINE=InnoDB AUTO_INCREMENT=27762 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `forums`
--

DROP TABLE IF EXISTS `forums`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `forums` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text,
  `topic_count` int(11) DEFAULT '0',
  `memo_count` int(11) DEFAULT '0',
  `last_memo_id` int(11) DEFAULT '0',
  `creator_id` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `sticky` int(11) DEFAULT NULL,
  `locked` int(11) DEFAULT NULL,
  `visits` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `forwards`
--

DROP TABLE IF EXISTS `forwards`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `forwards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `from_id` int(11) DEFAULT NULL,
  `from_type` varchar(255) DEFAULT NULL,
  `to_id` int(11) DEFAULT NULL,
  `to_type` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=778 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `game_codes`
--

DROP TABLE IF EXISTS `game_codes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `game_codes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `game_id` int(11) DEFAULT NULL,
  `original_code` longtext,
  `new_code` longtext,
  `path` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `current_code` longtext,
  `votes` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `game_id` (`game_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1748466 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `game_outputs`
--

DROP TABLE IF EXISTS `game_outputs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `game_outputs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` int(11) DEFAULT NULL,
  `game_id` int(11) DEFAULT NULL,
  `msg` text,
  `out_put` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `games`
--

DROP TABLE IF EXISTS `games`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `games` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `myshixun_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` int(11) DEFAULT '0',
  `final_score` int(11) DEFAULT '0',
  `challenge_id` int(11) DEFAULT NULL,
  `open_time` datetime DEFAULT NULL,
  `identifier` varchar(255) DEFAULT NULL,
  `answer_open` int(11) DEFAULT '0',
  `end_time` datetime DEFAULT NULL,
  `retry_status` int(11) DEFAULT '0',
  `resubmit_identifier` varchar(255) DEFAULT NULL,
  `test_sets_view` tinyint(1) DEFAULT '0',
  `picture_path` text,
  `accuracy` float DEFAULT NULL,
  `modify_time` datetime DEFAULT NULL,
  `star` int(11) DEFAULT '0',
  `cost_time` int(11) DEFAULT '0',
  `evaluate_count` int(11) DEFAULT '0',
  `answer_deduction` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `challenge` (`challenge_id`),
  KEY `myshixun` (`myshixun_id`),
  KEY `index_games_on_identifier` (`identifier`)
) ENGINE=InnoDB AUTO_INCREMENT=2162763 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `gitlab_urls`
--

DROP TABLE IF EXISTS `gitlab_urls`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gitlab_urls` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `myshixun_id` int(11) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `myshixun_identifier` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16162 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `grades`
--

DROP TABLE IF EXISTS `grades`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `grades` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `score` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `container` (`user_id`,`container_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3564548 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `graduation_groups`
--

DROP TABLE IF EXISTS `graduation_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `graduation_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_graduation_groups_on_user_id` (`user_id`),
  KEY `index_graduation_groups_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `graduation_task_group_assignations`
--

DROP TABLE IF EXISTS `graduation_task_group_assignations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `graduation_task_group_assignations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `graduation_task_id` int(11) DEFAULT NULL,
  `graduation_group_id` int(11) DEFAULT NULL,
  `assign_graduation_group_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_graduation_task_group_assignations_on_graduation_task_id` (`graduation_task_id`),
  KEY `index_graduation_task_group_assignations_on_graduation_group_id` (`graduation_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `graduation_tasks`
--

DROP TABLE IF EXISTS `graduation_tasks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `graduation_tasks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `description` text,
  `status` int(11) DEFAULT '0',
  `publish_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `task_type` int(11) DEFAULT '1',
  `course_id` int(11) DEFAULT NULL,
  `cross_comment` tinyint(1) DEFAULT '0',
  `min_num` int(11) DEFAULT '2',
  `max_num` int(11) DEFAULT '5',
  `base_on_project` tinyint(1) DEFAULT '0',
  `allow_late` tinyint(1) DEFAULT '0',
  `late_penalty` int(11) DEFAULT '0',
  `comment_time` datetime DEFAULT NULL,
  `comment_num` int(11) DEFAULT '3',
  `comment_status` int(11) DEFAULT '0',
  `open_work` tinyint(1) DEFAULT '1',
  `open_score` tinyint(1) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `is_public` tinyint(1) DEFAULT '0',
  `late_time` datetime DEFAULT NULL,
  `gtask_bank_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_graduation_tasks_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `graduation_topics`
--

DROP TABLE IF EXISTS `graduation_topics`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `graduation_topics` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `tea_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `status` int(11) DEFAULT '0',
  `topic_type` int(11) DEFAULT NULL,
  `topic_source` int(11) DEFAULT NULL,
  `topic_property_first` int(11) DEFAULT NULL,
  `topic_property_second` int(11) DEFAULT NULL,
  `source_unit` varchar(255) DEFAULT NULL,
  `topic_repeat` int(11) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `quotes` int(11) DEFAULT '0',
  `gtopic_bank_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_graduation_topics_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=121 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `graduation_work_comment_assignations`
--

DROP TABLE IF EXISTS `graduation_work_comment_assignations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `graduation_work_comment_assignations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `graduation_work_id` int(11) DEFAULT NULL,
  `graduation_task_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `graduation_group_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_graduation_work_comment_assignations_on_graduation_work_id` (`graduation_work_id`),
  KEY `index_graduation_work_comment_assignations_on_graduation_task_id` (`graduation_task_id`),
  KEY `index_graduation_work_comment_assignations_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `graduation_work_scores`
--

DROP TABLE IF EXISTS `graduation_work_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `graduation_work_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `graduation_work_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `graduation_task_id` int(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `comment` text,
  `reviewer_role` int(11) DEFAULT NULL,
  `is_hidden` tinyint(1) DEFAULT '0',
  `is_ultimate` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `is_invalid` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_graduation_work_scores_on_graduation_work_id` (`graduation_work_id`),
  KEY `index_graduation_work_scores_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `graduation_works`
--

DROP TABLE IF EXISTS `graduation_works`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `graduation_works` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `graduation_task_id` int(11) DEFAULT NULL,
  `description` text,
  `course_id` int(11) DEFAULT NULL,
  `teacher_score` float DEFAULT NULL,
  `cross_score` float DEFAULT NULL,
  `work_score` float DEFAULT NULL,
  `project_id` int(11) DEFAULT '0',
  `late_penalty` int(11) DEFAULT '0',
  `work_status` int(11) DEFAULT '0',
  `commit_time` datetime DEFAULT NULL,
  `group_id` int(11) DEFAULT '0',
  `commit_user_id` int(11) DEFAULT NULL,
  `ultimate_score` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `final_score` float DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `is_delete` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_graduation_task_id_and_user_id` (`graduation_task_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2891 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `groups_users`
--

DROP TABLE IF EXISTS `groups_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `groups_users` (
  `group_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  UNIQUE KEY `groups_users_ids` (`group_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `gtask_banks`
--

DROP TABLE IF EXISTS `gtask_banks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gtask_banks` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `task_type` int(11) DEFAULT NULL,
  `min_num` int(11) DEFAULT '0',
  `max_num` int(11) DEFAULT '0',
  `base_on_project` int(11) DEFAULT '0',
  `is_public` tinyint(1) DEFAULT '0',
  `quotes` int(11) DEFAULT '0',
  `graduation_task_id` bigint(20) DEFAULT NULL,
  `course_list_id` bigint(20) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_gtask_banks_on_user_id` (`user_id`),
  KEY `index_gtask_banks_on_graduation_task_id` (`graduation_task_id`),
  KEY `index_gtask_banks_on_course_list_id` (`course_list_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `gtopic_banks`
--

DROP TABLE IF EXISTS `gtopic_banks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gtopic_banks` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `quotes` int(11) DEFAULT '0',
  `is_public` tinyint(1) DEFAULT NULL,
  `topic_type` int(11) DEFAULT NULL,
  `topic_source` int(11) DEFAULT NULL,
  `topic_property_first` int(11) DEFAULT NULL,
  `topic_property_second` int(11) DEFAULT NULL,
  `source_unit` varchar(255) DEFAULT NULL,
  `topic_repeat` int(11) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `graduation_topic_id` bigint(20) DEFAULT NULL,
  `course_list_id` bigint(20) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_gtopic_banks_on_user_id` (`user_id`),
  KEY `index_gtopic_banks_on_graduation_topic_id` (`graduation_topic_id`),
  KEY `index_gtopic_banks_on_course_list_id` (`course_list_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `helps`
--

DROP TABLE IF EXISTS `helps`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `helps` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `about_us` text,
  `agreement` text,
  `status` text,
  `help_center` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homepages`
--

DROP TABLE IF EXISTS `homepages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homepages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `article_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homepages_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=23840 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_attaches`
--

DROP TABLE IF EXISTS `homework_attaches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_attaches` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bid_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `reward` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `state` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT '0',
  `score` float DEFAULT '0',
  `is_teacher_score` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_homework_attaches_on_bid_id` (`bid_id`)
) ENGINE=InnoDB AUTO_INCREMENT=24754 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_bank_samples`
--

DROP TABLE IF EXISTS `homework_bank_samples`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_bank_samples` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input` text,
  `output` text,
  `homework_bank_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_bank_samples_on_homework_bank_id` (`homework_bank_id`)
) ENGINE=InnoDB AUTO_INCREMENT=197 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_bank_shixuns`
--

DROP TABLE IF EXISTS `homework_bank_shixuns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_bank_shixuns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_bank_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_bank_shixuns_on_homework_bank_id` (`homework_bank_id`),
  KEY `index_homework_bank_shixuns_on_shixun_id` (`shixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_bank_tests`
--

DROP TABLE IF EXISTS `homework_bank_tests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_bank_tests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input` text,
  `output` text,
  `test_type` tinyint(1) DEFAULT NULL,
  `homework_bank_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40569 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_banks`
--

DROP TABLE IF EXISTS `homework_banks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_banks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `homework_type` int(11) DEFAULT NULL,
  `quotes` int(11) DEFAULT '0',
  `is_public` tinyint(1) DEFAULT NULL,
  `language` varchar(255) DEFAULT NULL,
  `standard_code` longtext,
  `min_num` int(11) DEFAULT NULL,
  `max_num` int(11) DEFAULT NULL,
  `base_on_project` tinyint(1) DEFAULT NULL,
  `applicable_syllabus` varchar(255) DEFAULT NULL,
  `homework_common_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `reference_answer` text,
  `syllabus_id` int(11) DEFAULT NULL,
  `major_level` text,
  `discipline_category_id` text,
  `first_level_discipline_id` text,
  `course_list_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_banks_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4440 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_challenge_settings`
--

DROP TABLE IF EXISTS `homework_challenge_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_challenge_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_common_id` int(11) DEFAULT NULL,
  `challenge_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_on_homework_common_id_challenge_id` (`homework_common_id`,`challenge_id`),
  KEY `index_homework_challenge_settings_on_homework_common_id` (`homework_common_id`),
  KEY `index_homework_challenge_settings_on_challenge_id` (`challenge_id`)
) ENGINE=InnoDB AUTO_INCREMENT=108379 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_commons`
--

DROP TABLE IF EXISTS `homework_commons`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_commons` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `description` text,
  `publish_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `homework_type` int(11) DEFAULT '1',
  `late_penalty` varchar(255) DEFAULT '0',
  `course_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `teacher_priority` int(11) DEFAULT '1',
  `anonymous_comment` tinyint(1) DEFAULT '0',
  `quotes` int(11) DEFAULT '0',
  `is_open` int(11) DEFAULT '0',
  `simi_time` datetime DEFAULT NULL,
  `score_open` tinyint(1) DEFAULT '1',
  `anonymous_appeal` tinyint(1) DEFAULT '0',
  `homework_bank_id` int(11) DEFAULT NULL,
  `is_update` tinyint(1) DEFAULT '0',
  `is_public` tinyint(1) DEFAULT '0',
  `reference_answer` text,
  `answer_public` tinyint(1) DEFAULT '1',
  `archive_time` datetime DEFAULT NULL,
  `allow_late` tinyint(1) DEFAULT '0',
  `late_time` datetime DEFAULT NULL,
  `work_public` tinyint(1) DEFAULT '1',
  `explanation` text,
  `unified_setting` tinyint(1) DEFAULT '1',
  `comment_public` tinyint(1) DEFAULT '1',
  `course_homework_category_id` int(11) DEFAULT NULL,
  `work_efficiency` tinyint(1) DEFAULT '0',
  `eff_score` int(11) DEFAULT '0',
  `max_efficiency` float DEFAULT '0',
  `course_second_category_id` int(11) DEFAULT '0',
  `calculation_time` datetime DEFAULT NULL,
  `position` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_homework_commons_on_course_id_and_id` (`course_id`,`id`),
  KEY `index_homework_commons_on_course_second_category_id` (`course_second_category_id`),
  KEY `index_homework_commons_on_homework_bank_id` (`homework_bank_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35840 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_commons_shixuns`
--

DROP TABLE IF EXISTS `homework_commons_shixuns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_commons_shixuns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `homework_common_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_commons_shixuns_on_homework_common_id` (`homework_common_id`)
) ENGINE=InnoDB AUTO_INCREMENT=27842 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_detail_groups`
--

DROP TABLE IF EXISTS `homework_detail_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_detail_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_common_id` int(11) DEFAULT NULL,
  `min_num` int(11) DEFAULT NULL,
  `max_num` int(11) DEFAULT NULL,
  `base_on_project` tinyint(1) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_detail_groups_on_homework_common_id` (`homework_common_id`)
) ENGINE=InnoDB AUTO_INCREMENT=575 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_detail_manuals`
--

DROP TABLE IF EXISTS `homework_detail_manuals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_detail_manuals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ta_proportion` float DEFAULT '0',
  `comment_status` int(11) DEFAULT '0',
  `evaluation_start` datetime DEFAULT NULL,
  `evaluation_end` datetime DEFAULT NULL,
  `evaluation_num` int(11) DEFAULT '0',
  `absence_penalty` int(11) DEFAULT '0',
  `homework_common_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `no_anon_penalty` int(11) DEFAULT '1',
  `appeal_penalty` int(11) DEFAULT '0',
  `ta_mode` int(11) DEFAULT '1',
  `appeal_time` datetime DEFAULT NULL,
  `te_proportion` float DEFAULT '1',
  `final_mode` tinyint(1) DEFAULT '0',
  `answer_open_evaluation` tinyint(1) DEFAULT '0',
  `shixun_evaluation` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_homework_detail_manuals_on_homework_common_id` (`homework_common_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35827 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_detail_programings`
--

DROP TABLE IF EXISTS `homework_detail_programings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_detail_programings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `language` varchar(255) DEFAULT NULL,
  `standard_code` longtext,
  `homework_common_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ta_proportion` float DEFAULT '0.1',
  `question_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2766 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_evaluations`
--

DROP TABLE IF EXISTS `homework_evaluations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_evaluations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` varchar(255) DEFAULT NULL,
  `homework_attach_id` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17792 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_for_courses`
--

DROP TABLE IF EXISTS `homework_for_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_for_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `bid_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_for_courses_on_course_id` (`course_id`),
  KEY `index_homework_for_courses_on_bid_id` (`bid_id`)
) ENGINE=InnoDB AUTO_INCREMENT=737 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_group_reviews`
--

DROP TABLE IF EXISTS `homework_group_reviews`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_group_reviews` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_common_id` int(11) DEFAULT NULL,
  `course_group_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `query_id` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_group_reviews_on_homework_common_id` (`homework_common_id`),
  KEY `index_homework_group_reviews_on_course_group_id` (`course_group_id`),
  KEY `index_homework_group_reviews_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=454 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_group_settings`
--

DROP TABLE IF EXISTS `homework_group_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_group_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_common_id` int(11) DEFAULT NULL,
  `course_group_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `publish_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_group_settings_on_homework_common_id` (`homework_common_id`),
  KEY `index_homework_group_settings_on_course_group_id` (`course_group_id`),
  KEY `index_homework_group_settings_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2968 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_reference_answers`
--

DROP TABLE IF EXISTS `homework_reference_answers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_reference_answers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `answer` text,
  `homework_common_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_reference_answers_on_homework_common_id` (`homework_common_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_review_results`
--

DROP TABLE IF EXISTS `homework_review_results`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_review_results` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_common_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `code_rate` float DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_review_results_on_homework_common_id` (`homework_common_id`),
  KEY `index_homework_review_results_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3606 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_samples`
--

DROP TABLE IF EXISTS `homework_samples`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_samples` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input` text,
  `output` text,
  `homework_common_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_homework_samples_on_homework_common_id` (`homework_common_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1212 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_seconds`
--

DROP TABLE IF EXISTS `homework_seconds`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_seconds` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `description` text,
  `publish_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `homework_type` int(11) DEFAULT '1',
  `late_penalty` varchar(255) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `teacher_priority` int(11) DEFAULT '1',
  `anonymous_comment` int(11) DEFAULT '0',
  `quotes` int(11) DEFAULT '0',
  `is_open` int(11) DEFAULT '0',
  `simi_time` datetime DEFAULT NULL,
  `score_open` int(11) DEFAULT '1',
  `anonymous_appeal` int(11) DEFAULT '0',
  `homework_bank_id` int(11) DEFAULT NULL,
  `is_update` tinyint(1) DEFAULT '0',
  `is_public` tinyint(1) DEFAULT '0',
  `reference_answer` text,
  `answer_public` tinyint(1) DEFAULT '1',
  `archive_time` datetime DEFAULT NULL,
  `allow_late` tinyint(1) DEFAULT '1',
  `late_time` datetime DEFAULT NULL,
  `work_public` tinyint(1) DEFAULT '1',
  `explanation` text,
  `unified_setting` tinyint(1) DEFAULT '1',
  `comment_public` tinyint(1) DEFAULT '1',
  `course_homework_category_id` int(11) DEFAULT NULL,
  `work_efficiency` tinyint(1) DEFAULT '1',
  `eff_score` int(11) DEFAULT '20',
  `max_efficiency` float DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_homework_seconds_on_course_id_and_id` (`course_id`,`id`),
  KEY `index_homework_seconds_on_course_homework_category_id` (`course_homework_category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21549 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_tests`
--

DROP TABLE IF EXISTS `homework_tests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_tests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input` text,
  `output` text,
  `homework_common_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `result` int(11) DEFAULT NULL,
  `error_msg` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=51640 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `homework_users`
--

DROP TABLE IF EXISTS `homework_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `homework_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_attach_id` varchar(255) DEFAULT NULL,
  `user_id` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `import_course_users`
--

DROP TABLE IF EXISTS `import_course_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `import_course_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_student_id` varchar(255) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `user_group_name` varchar(255) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `status` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_import_course_users_on_course_id` (`course_id`),
  KEY `index_import_course_users_on_school_id` (`school_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `import_students`
--

DROP TABLE IF EXISTS `import_students`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `import_students` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `student_number` varchar(255) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `informs`
--

DROP TABLE IF EXISTS `informs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `informs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `innodb_monitor`
--

DROP TABLE IF EXISTS `innodb_monitor`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `innodb_monitor` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `invite_lists`
--

DROP TABLE IF EXISTS `invite_lists`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invite_lists` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `mail` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=141 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `issue_categories`
--

DROP TABLE IF EXISTS `issue_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `issue_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `name` varchar(30) NOT NULL DEFAULT '',
  `assigned_to_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `issue_categories_project_id` (`project_id`),
  KEY `index_issue_categories_on_assigned_to_id` (`assigned_to_id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `issue_relations`
--

DROP TABLE IF EXISTS `issue_relations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `issue_relations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `issue_from_id` int(11) NOT NULL,
  `issue_to_id` int(11) NOT NULL,
  `relation_type` varchar(255) NOT NULL DEFAULT '',
  `delay` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_issue_relations_on_issue_from_id_and_issue_to_id` (`issue_from_id`,`issue_to_id`),
  KEY `index_issue_relations_on_issue_from_id` (`issue_from_id`),
  KEY `index_issue_relations_on_issue_to_id` (`issue_to_id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `issue_statuses`
--

DROP TABLE IF EXISTS `issue_statuses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `issue_statuses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL DEFAULT '',
  `is_closed` tinyint(1) NOT NULL DEFAULT '0',
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `position` int(11) DEFAULT '1',
  `default_done_ratio` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_issue_statuses_on_position` (`position`),
  KEY `index_issue_statuses_on_is_closed` (`is_closed`),
  KEY `index_issue_statuses_on_is_default` (`is_default`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `issues`
--

DROP TABLE IF EXISTS `issues`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `issues` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tracker_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `subject` varchar(255) NOT NULL DEFAULT '',
  `description` text,
  `due_date` date DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `status_id` int(11) NOT NULL,
  `assigned_to_id` int(11) DEFAULT NULL,
  `priority_id` int(11) NOT NULL,
  `fixed_version_id` int(11) DEFAULT NULL,
  `author_id` int(11) NOT NULL,
  `lock_version` int(11) NOT NULL DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `updated_on` datetime DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `done_ratio` int(11) NOT NULL DEFAULT '0',
  `estimated_hours` float DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `root_id` int(11) DEFAULT NULL,
  `lft` int(11) DEFAULT NULL,
  `rgt` int(11) DEFAULT NULL,
  `is_private` tinyint(1) NOT NULL DEFAULT '0',
  `closed_on` datetime DEFAULT NULL,
  `project_issues_index` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `issues_project_id` (`project_id`),
  KEY `index_issues_on_status_id` (`status_id`),
  KEY `index_issues_on_category_id` (`category_id`),
  KEY `index_issues_on_assigned_to_id` (`assigned_to_id`),
  KEY `index_issues_on_fixed_version_id` (`fixed_version_id`),
  KEY `index_issues_on_tracker_id` (`tracker_id`),
  KEY `index_issues_on_priority_id` (`priority_id`),
  KEY `index_issues_on_author_id` (`author_id`),
  KEY `index_issues_on_created_on` (`created_on`),
  KEY `index_issues_on_root_id_and_lft_and_rgt` (`root_id`,`lft`,`rgt`)
) ENGINE=InnoDB AUTO_INCREMENT=13241 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `join_in_competitions`
--

DROP TABLE IF EXISTS `join_in_competitions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `join_in_competitions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `competition_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `join_in_contests`
--

DROP TABLE IF EXISTS `join_in_contests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `join_in_contests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `bid_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `journal_details`
--

DROP TABLE IF EXISTS `journal_details`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `journal_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `journal_id` int(11) NOT NULL DEFAULT '0',
  `property` varchar(30) NOT NULL DEFAULT '',
  `prop_key` varchar(30) NOT NULL DEFAULT '',
  `old_value` text,
  `value` text,
  PRIMARY KEY (`id`),
  KEY `journal_details_journal_id` (`journal_id`)
) ENGINE=InnoDB AUTO_INCREMENT=26894 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `journal_replies`
--

DROP TABLE IF EXISTS `journal_replies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `journal_replies` (
  `journal_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `reply_id` int(11) DEFAULT NULL,
  KEY `index_journal_replies_on_user_id` (`user_id`),
  KEY `index_journal_replies_on_journal_id` (`journal_id`),
  KEY `index_journal_replies_on_reply_id` (`reply_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `journals`
--

DROP TABLE IF EXISTS `journals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `journals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `journalized_id` int(11) NOT NULL DEFAULT '0',
  `journalized_type` varchar(30) NOT NULL DEFAULT '',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `notes` text,
  `created_on` datetime NOT NULL,
  `private_notes` tinyint(1) NOT NULL DEFAULT '0',
  `parent_id` int(11) DEFAULT NULL,
  `comments_count` int(11) DEFAULT '0',
  `reply_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `journals_journalized_id` (`journalized_id`,`journalized_type`),
  KEY `index_journals_on_user_id` (`user_id`),
  KEY `index_journals_on_journalized_id` (`journalized_id`),
  KEY `index_journals_on_created_on` (`created_on`)
) ENGINE=InnoDB AUTO_INCREMENT=22428 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `journals_for_messages`
--

DROP TABLE IF EXISTS `journals_for_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `journals_for_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `jour_id` int(11) DEFAULT NULL,
  `jour_type` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `notes` text,
  `status` int(11) DEFAULT NULL,
  `reply_id` int(11) DEFAULT NULL,
  `created_on` datetime NOT NULL,
  `updated_on` datetime NOT NULL,
  `m_parent_id` varchar(255) DEFAULT NULL,
  `is_readed` tinyint(1) DEFAULT NULL,
  `m_reply_count` int(11) DEFAULT NULL,
  `m_reply_id` int(11) DEFAULT NULL,
  `is_comprehensive_evaluation` int(11) DEFAULT NULL,
  `private` int(11) DEFAULT '0',
  `root_id` int(11) DEFAULT NULL,
  `hidden` tinyint(1) DEFAULT '0',
  `praises_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_journals_for_messages_on_root_id` (`root_id`),
  KEY `index_journals_for_messages_on_jour_id` (`jour_id`)
) ENGINE=InnoDB AUTO_INCREMENT=82865 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `kindeditor_assets`
--

DROP TABLE IF EXISTS `kindeditor_assets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `kindeditor_assets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `asset` varchar(255) DEFAULT NULL,
  `file_size` int(11) DEFAULT NULL,
  `file_type` varchar(255) DEFAULT NULL,
  `owner_id` int(11) DEFAULT NULL,
  `asset_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `owner_type` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=49751 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `libraries`
--

DROP TABLE IF EXISTS `libraries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `libraries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `content` text,
  `uuid` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `visited_count` int(11) DEFAULT '0',
  `published_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `author_name` varchar(255) DEFAULT NULL,
  `author_school_name` varchar(255) DEFAULT NULL,
  `cover_id` int(11) DEFAULT NULL,
  `praises_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_libraries_on_published_at` (`published_at`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `library_applies`
--

DROP TABLE IF EXISTS `library_applies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `library_applies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `library_id` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `refused_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_library_applies_on_refused_at` (`refused_at`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `library_library_tags`
--

DROP TABLE IF EXISTS `library_library_tags`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `library_library_tags` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `library_id` int(11) DEFAULT NULL,
  `library_tag_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `library_tags`
--

DROP TABLE IF EXISTS `library_tags`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `library_tags` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `local_challenge_tags`
--

DROP TABLE IF EXISTS `local_challenge_tags`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `local_challenge_tags` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `local_challenge_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `local_challenges`
--

DROP TABLE IF EXISTS `local_challenges`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `local_challenges` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `local_shixun_id` int(11) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `task_pass` text,
  `answer` text,
  `score` int(11) DEFAULT NULL,
  `visits` int(11) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  `evaluation_way` int(11) DEFAULT NULL,
  `difficulty` int(11) DEFAULT NULL,
  `exec_path` varchar(255) DEFAULT NULL,
  `code_line` int(11) DEFAULT NULL,
  `st` int(11) DEFAULT NULL,
  `web_route` text,
  `picture_path` text,
  `expect_picture_path` text,
  `challenge_tags_count` int(11) DEFAULT NULL,
  `modify_time` datetime DEFAULT NULL,
  `original_picture_path` varchar(255) DEFAULT NULL,
  `show_type` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `test_set_score` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `local_mirror_repositories`
--

DROP TABLE IF EXISTS `local_mirror_repositories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `local_mirror_repositories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `local_shixun_id` int(11) DEFAULT NULL,
  `mirror_repository_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `type_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `local_shixun_tag_repertoires`
--

DROP TABLE IF EXISTS `local_shixun_tag_repertoires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `local_shixun_tag_repertoires` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tag_repertoire_id` int(11) DEFAULT NULL,
  `local_shixun_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `local_shixuns`
--

DROP TABLE IF EXISTS `local_shixuns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `local_shixuns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `user_id` int(11) DEFAULT NULL,
  `gpid` int(11) DEFAULT NULL,
  `visits` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `language` varchar(255) DEFAULT NULL,
  `authentication` text,
  `identifier` varchar(255) DEFAULT NULL,
  `propaedeutics` text,
  `trainee` int(11) DEFAULT NULL,
  `major_id` int(11) DEFAULT NULL,
  `webssh` int(11) DEFAULT NULL,
  `homepage_show` tinyint(1) DEFAULT NULL,
  `hidden` tinyint(1) DEFAULT NULL,
  `fork_from` int(11) DEFAULT NULL,
  `can_copy` tinyint(1) DEFAULT NULL,
  `modifiy_tim` datetime DEFAULT NULL,
  `reset_time` datetime DEFAULT NULL,
  `closer_id` int(11) DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `git_url` varchar(255) DEFAULT NULL,
  `vnc` tinyint(1) DEFAULT NULL,
  `myshixuns_count` int(11) DEFAULT NULL,
  `challenges_count` int(11) DEFAULT NULL,
  `use_scope` int(11) DEFAULT NULL,
  `evaluate_script` text,
  `mirror_script_id` int(11) DEFAULT NULL,
  `image_text` varchar(255) DEFAULT NULL,
  `code_hidden` tinyint(1) DEFAULT NULL,
  `task_pass` tinyint(1) DEFAULT NULL,
  `exec_time` int(11) DEFAULT NULL,
  `test_set_permission` varchar(255) DEFAULT NULL,
  `sigle_training` tinyint(1) DEFAULT NULL,
  `hide_code` tinyint(1) DEFAULT NULL,
  `multi_webssh` tinyint(1) DEFAULT NULL,
  `excute_time` int(11) DEFAULT NULL,
  `averge_star` int(11) DEFAULT NULL,
  `forbid_copy` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `local_giturl` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `local_test_sets`
--

DROP TABLE IF EXISTS `local_test_sets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `local_test_sets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input` text,
  `output` text,
  `local_challenge_id` int(11) DEFAULT NULL,
  `is_public` int(11) DEFAULT NULL,
  `result` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `score` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=311 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `major_courses`
--

DROP TABLE IF EXISTS `major_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `major_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_list_id` int(11) DEFAULT NULL,
  `major_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_major_courses_on_course_list_id` (`course_list_id`),
  KEY `index_major_courses_on_major_id` (`major_id`)
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `majors`
--

DROP TABLE IF EXISTS `majors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `majors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `major_code` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `first_level_discipline_id` int(11) DEFAULT NULL,
  `discipline_category_id` int(11) DEFAULT NULL,
  `major_level` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `support_shixuns` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_majors_on_first_level_discipline_id` (`first_level_discipline_id`),
  KEY `index_majors_on_discipline_category_id` (`discipline_category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1660 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mark_downs`
--

DROP TABLE IF EXISTS `mark_downs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mark_downs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `description` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `member_roles`
--

DROP TABLE IF EXISTS `member_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `member_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL,
  `role_id` int(11) NOT NULL,
  `inherited_from` int(11) DEFAULT NULL,
  `is_current` int(11) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `index_member_roles_on_member_id` (`member_id`),
  KEY `index_member_roles_on_role_id` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=134780 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `members`
--

DROP TABLE IF EXISTS `members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `project_id` int(11) DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `mail_notification` tinyint(1) NOT NULL DEFAULT '0',
  `course_id` int(11) DEFAULT '-1',
  `course_group_id` int(11) DEFAULT '0',
  `is_collect` int(11) DEFAULT '1',
  `graduation_group_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_members_on_user_id_and_project_id` (`user_id`,`project_id`,`course_id`),
  KEY `index_members_on_user_id` (`user_id`),
  KEY `index_members_on_project_id` (`project_id`),
  KEY `index_members_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=132761 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `memo_messages`
--

DROP TABLE IF EXISTS `memo_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `memo_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `forum_id` int(11) DEFAULT NULL,
  `memo_id` int(11) DEFAULT NULL,
  `memo_type` varchar(255) DEFAULT NULL,
  `viewed` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_memo_messages_on_user_id_and_forum_id_and_created_at` (`user_id`,`forum_id`,`created_at`),
  KEY `index_memo_messages_on_memo_id_and_memo_type` (`memo_id`,`memo_type`)
) ENGINE=InnoDB AUTO_INCREMENT=3891 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `memo_tag_repertoires`
--

DROP TABLE IF EXISTS `memo_tag_repertoires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `memo_tag_repertoires` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `memo_id` int(11) DEFAULT NULL,
  `tag_repertoire_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_memo_tag_repertoires_on_memo_id` (`memo_id`),
  KEY `index_memo_tag_repertoires_on_tag_repertoire_id` (`tag_repertoire_id`)
) ENGINE=InnoDB AUTO_INCREMENT=400 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `memos`
--

DROP TABLE IF EXISTS `memos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `memos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `forum_id` int(11) NOT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `content` longtext NOT NULL,
  `author_id` int(11) NOT NULL,
  `replies_count` int(11) DEFAULT '0',
  `last_reply_id` int(11) DEFAULT NULL,
  `lock` tinyint(1) DEFAULT '0',
  `sticky` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `viewed_count` int(11) DEFAULT '0',
  `root_id` int(11) DEFAULT NULL,
  `reward` int(11) DEFAULT NULL,
  `language` varchar(255) DEFAULT NULL,
  `hidden` tinyint(4) DEFAULT '0',
  `repertoire_name` varchar(255) DEFAULT NULL,
  `is_md` tinyint(1) DEFAULT '1',
  `all_replies_count` int(11) DEFAULT '0',
  `praises_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_memos_on_root_id` (`root_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3584 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `message_alls`
--

DROP TABLE IF EXISTS `message_alls`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `message_alls` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `message_id` int(11) DEFAULT NULL,
  `message_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_message_alls_on_user_id_and_message_id_and_created_at` (`user_id`,`message_id`,`created_at`),
  KEY `index_message_alls_on_message_type` (`message_type`)
) ENGINE=InnoDB AUTO_INCREMENT=974229 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `message_details`
--

DROP TABLE IF EXISTS `message_details`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `message_details` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `content` longtext,
  `message_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_message_details_on_message_id` (`message_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35979 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `messages`
--

DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `board_id` int(11) NOT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `subject` varchar(255) NOT NULL DEFAULT '',
  `author_id` int(11) DEFAULT NULL,
  `replies_count` int(11) NOT NULL DEFAULT '0',
  `last_reply_id` int(11) DEFAULT NULL,
  `created_on` datetime NOT NULL,
  `updated_on` datetime NOT NULL,
  `locked` tinyint(1) DEFAULT '0',
  `sticky` int(11) DEFAULT '0',
  `reply_id` int(11) DEFAULT NULL,
  `quotes` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `root_id` int(11) DEFAULT NULL,
  `visits` int(11) DEFAULT '0',
  `praises_count` int(11) DEFAULT '0',
  `is_hidden` tinyint(1) DEFAULT '0',
  `is_public` tinyint(1) DEFAULT '0',
  `descendants_count` int(11) DEFAULT '0',
  `is_md` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `messages_board_id` (`board_id`),
  KEY `messages_parent_id` (`parent_id`),
  KEY `index_messages_on_last_reply_id` (`last_reply_id`)
) ENGINE=InnoDB AUTO_INCREMENT=43606 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mirror_migrate_errors`
--

DROP TABLE IF EXISTS `mirror_migrate_errors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mirror_migrate_errors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `game_info` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mirror_operation_records`
--

DROP TABLE IF EXISTS `mirror_operation_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mirror_operation_records` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mirror_repository_id` int(11) DEFAULT NULL,
  `mirror_id` text,
  `mirror_name` text,
  `status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `old_tag` varchar(255) DEFAULT NULL,
  `new_tag` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1620 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mirror_repositories`
--

DROP TABLE IF EXISTS `mirror_repositories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mirror_repositories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mirrorID` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `main_type` varchar(255) DEFAULT NULL,
  `description` text,
  `status` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `type_name` text,
  `script_template` longtext,
  `resource_limit` int(11) DEFAULT '10000',
  `memory_limit` int(11) DEFAULT '1024',
  `cpu_limit` tinyint(4) DEFAULT '1',
  `time_limit` int(11) DEFAULT '120',
  `should_compile` tinyint(1) DEFAULT NULL,
  `repertoire_id` int(11) DEFAULT NULL,
  `sub_repertoire_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=128 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mirror_repository_types`
--

DROP TABLE IF EXISTS `mirror_repository_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mirror_repository_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mirror_type_id` int(11) DEFAULT NULL,
  `mirror_repository_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_mirror_repository_types_on_mirror_type_id` (`mirror_type_id`),
  KEY `index_mirror_repository_types_on_mirror_repository_id` (`mirror_repository_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mirror_scripts`
--

DROP TABLE IF EXISTS `mirror_scripts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mirror_scripts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mirror_repository_id` int(11) DEFAULT NULL,
  `script` longtext,
  `script_type` varchar(255) DEFAULT NULL,
  `description` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mirror_types`
--

DROP TABLE IF EXISTS `mirror_types`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mirror_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mirror_update_records`
--

DROP TABLE IF EXISTS `mirror_update_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mirror_update_records` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `mirror_repository_id` int(11) DEFAULT NULL,
  `oldName` varchar(255) DEFAULT NULL,
  `newName` varchar(255) DEFAULT NULL,
  `oldType` varchar(255) DEFAULT NULL,
  `newType` varchar(255) DEFAULT NULL,
  `oldTag` text,
  `newTag` text,
  `oldDescription` text,
  `newDescription` text,
  `oldStatus` int(11) DEFAULT NULL,
  `newStatus` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_mirror_update_records_on_user_id` (`user_id`),
  KEY `index_mirror_update_records_on_mirror_repository_id` (`mirror_repository_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `mul_tests`
--

DROP TABLE IF EXISTS `mul_tests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mul_tests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `action` varchar(255) DEFAULT NULL,
  `time` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `language` varchar(255) DEFAULT NULL,
  `num` int(11) DEFAULT NULL,
  `indentifier` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `myshixun_members`
--

DROP TABLE IF EXISTS `myshixun_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `myshixun_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `myshixun_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `role` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1434 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `myshixuns`
--

DROP TABLE IF EXISTS `myshixuns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `myshixuns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT '1',
  `user_id` int(11) DEFAULT NULL,
  `gpid` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` int(11) DEFAULT '0',
  `identifier` varchar(255) DEFAULT NULL,
  `commit_id` varchar(255) DEFAULT NULL,
  `modify_time` datetime DEFAULT NULL,
  `reset_time` datetime DEFAULT NULL,
  `system_tip` tinyint(1) DEFAULT '0',
  `git_url` varchar(255) DEFAULT NULL,
  `onclick_time` datetime DEFAULT NULL,
  `repo_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_myshixuns_on_user_id_and_shixun_id` (`user_id`,`shixun_id`),
  KEY `index_myshixuns_on_identifier` (`identifier`)
) ENGINE=InnoDB AUTO_INCREMENT=568618 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `news`
--

DROP TABLE IF EXISTS `news`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `title` varchar(60) NOT NULL DEFAULT '',
  `summary` varchar(255) DEFAULT '',
  `description` text,
  `author_id` int(11) NOT NULL DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `comments_count` int(11) NOT NULL DEFAULT '0',
  `course_id` int(11) DEFAULT NULL,
  `sticky` int(11) DEFAULT '0',
  `org_subfield_id` int(11) DEFAULT NULL,
  `contest_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `news_project_id` (`project_id`),
  KEY `index_news_on_author_id` (`author_id`),
  KEY `index_news_on_created_on` (`created_on`)
) ENGINE=InnoDB AUTO_INCREMENT=2585 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `no_uses`
--

DROP TABLE IF EXISTS `no_uses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `no_uses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `no_use_type` varchar(255) DEFAULT NULL,
  `no_use_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `notificationcomments`
--

DROP TABLE IF EXISTS `notificationcomments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notificationcomments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `notificationcommented_type` varchar(255) DEFAULT NULL,
  `notificationcommented_id` int(11) DEFAULT NULL,
  `author_id` int(11) DEFAULT NULL,
  `notificationcomments` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `oauth_configs`
--

DROP TABLE IF EXISTS `oauth_configs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauth_configs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` varchar(255) DEFAULT NULL,
  `client_secret` varchar(255) DEFAULT NULL,
  `redirect_uri` varchar(255) DEFAULT NULL,
  `scope` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `oauths`
--

DROP TABLE IF EXISTS `oauths`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oauths` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` varchar(255) DEFAULT NULL,
  `client_secret` varchar(255) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `redirect_uri` varchar(255) DEFAULT NULL,
  `scope` varchar(255) DEFAULT NULL,
  `access_token` varchar(255) DEFAULT NULL,
  `refresh_token` varchar(255) DEFAULT NULL,
  `token_created_at` int(11) DEFAULT NULL,
  `token_expires_in` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `user_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_oauths_on_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `old_message_details`
--

DROP TABLE IF EXISTS `old_message_details`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `old_message_details` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `content` longtext,
  `message_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_message_details_on_message_id` (`message_id`)
) ENGINE=InnoDB AUTO_INCREMENT=40378 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `onclick_times`
--

DROP TABLE IF EXISTS `onclick_times`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `onclick_times` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `onclick_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_onclick_times_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=77928 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `open_id_authentication_associations`
--

DROP TABLE IF EXISTS `open_id_authentication_associations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `open_id_authentication_associations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `issued` int(11) DEFAULT NULL,
  `lifetime` int(11) DEFAULT NULL,
  `handle` varchar(255) DEFAULT NULL,
  `assoc_type` varchar(255) DEFAULT NULL,
  `server_url` blob,
  `secret` blob,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `open_id_authentication_nonces`
--

DROP TABLE IF EXISTS `open_id_authentication_nonces`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `open_id_authentication_nonces` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `timestamp` int(11) NOT NULL,
  `server_url` varchar(255) DEFAULT NULL,
  `salt` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `open_source_projects`
--

DROP TABLE IF EXISTS `open_source_projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `open_source_projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `commit_count` int(11) DEFAULT '0',
  `code_line` int(11) DEFAULT '0',
  `users_count` int(11) DEFAULT '0',
  `last_commit_time` date DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `date_collected` date DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=488570 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `openis`
--

DROP TABLE IF EXISTS `openis`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `openis` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `openi_user_id` int(11) DEFAULT NULL,
  `login` varchar(255) DEFAULT NULL,
  `avatar_url` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `allow` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `option_numbers`
--

DROP TABLE IF EXISTS `option_numbers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `option_numbers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `memo` int(11) DEFAULT NULL,
  `messages_for_issues` int(11) DEFAULT NULL,
  `issues_status` int(11) DEFAULT NULL,
  `replay_for_message` int(11) DEFAULT NULL,
  `replay_for_memo` int(11) DEFAULT NULL,
  `follow` int(11) DEFAULT NULL,
  `tread` int(11) DEFAULT NULL,
  `praise_by_one` int(11) DEFAULT NULL,
  `praise_by_two` int(11) DEFAULT NULL,
  `praise_by_three` int(11) DEFAULT NULL,
  `tread_by_one` int(11) DEFAULT NULL,
  `tread_by_two` int(11) DEFAULT NULL,
  `tread_by_three` int(11) DEFAULT NULL,
  `changeset` int(11) DEFAULT NULL,
  `document` int(11) DEFAULT NULL,
  `attachment` int(11) DEFAULT NULL,
  `issue_done_ratio` int(11) DEFAULT NULL,
  `post_issue` int(11) DEFAULT NULL,
  `score_type` int(11) DEFAULT NULL,
  `total_score` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `project_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33885 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_activities`
--

DROP TABLE IF EXISTS `org_activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `org_act_id` int(11) DEFAULT NULL,
  `org_act_type` varchar(255) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=74947 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_courses`
--

DROP TABLE IF EXISTS `org_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `organization_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_document_comments`
--

DROP TABLE IF EXISTS `org_document_comments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_document_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text,
  `content` text,
  `organization_id` int(11) DEFAULT NULL,
  `creator_id` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `reply_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `locked` tinyint(1) DEFAULT '0',
  `sticky` int(11) DEFAULT '0',
  `org_subfield_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `root_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_org_document_comments_on_root_id` (`root_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6511 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_member_roles`
--

DROP TABLE IF EXISTS `org_member_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_member_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `org_member_id` int(11) DEFAULT NULL,
  `role_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=634 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_members`
--

DROP TABLE IF EXISTS `org_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `organization_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=637 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_messages`
--

DROP TABLE IF EXISTS `org_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `sender_id` int(11) DEFAULT NULL,
  `organization_id` int(11) DEFAULT NULL,
  `message_type` varchar(255) DEFAULT NULL,
  `message_id` int(11) DEFAULT NULL,
  `viewed` int(11) DEFAULT NULL,
  `content` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=233 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_projects`
--

DROP TABLE IF EXISTS `org_projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `organization_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=138 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_subfield_messages`
--

DROP TABLE IF EXISTS `org_subfield_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_subfield_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `org_subfield_id` int(11) DEFAULT NULL,
  `message_id` int(11) DEFAULT NULL,
  `message_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `org_subfields`
--

DROP TABLE IF EXISTS `org_subfields`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `org_subfields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `organization_id` int(11) DEFAULT NULL,
  `priority` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `field_type` varchar(255) DEFAULT NULL,
  `hide` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=717 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `organizations`
--

DROP TABLE IF EXISTS `organizations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `organizations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `creator_id` int(11) DEFAULT NULL,
  `home_id` int(11) DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `allow_guest_download` tinyint(1) DEFAULT '1',
  `visits` int(11) DEFAULT '0',
  `show_mode` int(11) DEFAULT '0',
  `allow_teacher` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=150 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `outputs`
--

DROP TABLE IF EXISTS `outputs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `outputs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` int(11) DEFAULT NULL,
  `game_id` int(11) DEFAULT NULL,
  `msg` text,
  `out_put` longtext,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `test_set_position` int(11) DEFAULT NULL,
  `actual_output` longtext,
  `result` tinyint(1) DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT NULL,
  `query_index` int(11) DEFAULT '1',
  `compile_success` int(11) DEFAULT '1',
  `text_scor` varchar(255) DEFAULT NULL,
  `sec_key` varchar(255) DEFAULT NULL,
  `ts_mem` float DEFAULT NULL,
  `ts_time` float DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `game` (`game_id`,`query_index`)
) ENGINE=InnoDB AUTO_INCREMENT=23474589 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `partner_customers`
--

DROP TABLE IF EXISTS `partner_customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `partner_customers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `partner_id` int(11) DEFAULT NULL,
  `customer_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `partners`
--

DROP TABLE IF EXISTS `partners`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `partners` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `school_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `phone_app_versions`
--

DROP TABLE IF EXISTS `phone_app_versions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `phone_app_versions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version` varchar(255) DEFAULT NULL,
  `description` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `platform_samples`
--

DROP TABLE IF EXISTS `platform_samples`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `platform_samples` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `samples_type` varchar(255) DEFAULT NULL,
  `contents` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_answers`
--

DROP TABLE IF EXISTS `poll_answers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_answers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `poll_question_id` int(11) DEFAULT NULL,
  `answer_text` text,
  `answer_position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_poll_answers_on_poll_question_id` (`poll_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8119 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_group_settings`
--

DROP TABLE IF EXISTS `poll_group_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_group_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `poll_id` int(11) DEFAULT NULL,
  `course_group_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `publish_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_poll_group_settings_on_poll_id` (`poll_id`),
  KEY `index_poll_group_settings_on_course_group_id` (`course_group_id`),
  KEY `index_poll_group_settings_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_questions`
--

DROP TABLE IF EXISTS `poll_questions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_questions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question_title` text,
  `question_type` int(11) DEFAULT NULL,
  `is_necessary` int(11) DEFAULT NULL,
  `poll_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `question_number` int(11) DEFAULT NULL,
  `max_choices` int(11) DEFAULT '0',
  `min_choices` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_poll_questions_on_poll_id` (`poll_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2454 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_users`
--

DROP TABLE IF EXISTS `poll_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `poll_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `commit_status` int(11) DEFAULT '0',
  `start_at` datetime DEFAULT NULL,
  `end_at` datetime DEFAULT NULL,
  `is_delete` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_poll_id_and_user_id` (`poll_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=46130 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_votes`
--

DROP TABLE IF EXISTS `poll_votes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_votes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `poll_question_id` int(11) DEFAULT NULL,
  `poll_answer_id` int(11) DEFAULT NULL,
  `vote_text` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `poll_question_id_user_id` (`poll_question_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=72012 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `polls`
--

DROP TABLE IF EXISTS `polls`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `polls` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `polls_name` varchar(255) DEFAULT NULL,
  `polls_type` varchar(255) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `polls_status` int(11) DEFAULT '1',
  `user_id` int(11) DEFAULT NULL,
  `publish_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `polls_description` text,
  `show_result` int(11) DEFAULT '1',
  `exercise_bank_id` int(11) DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT '0',
  `unified_setting` tinyint(1) DEFAULT '1',
  `un_anonymous` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_polls_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=693 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `portal_images`
--

DROP TABLE IF EXISTS `portal_images`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `portal_images` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `link` varchar(255) DEFAULT NULL,
  `status` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `praise_tread_caches`
--

DROP TABLE IF EXISTS `praise_tread_caches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `praise_tread_caches` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `object_id` int(11) NOT NULL,
  `object_type` varchar(255) DEFAULT NULL,
  `praise_num` int(11) DEFAULT NULL,
  `tread_num` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12689 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `praise_treads`
--

DROP TABLE IF EXISTS `praise_treads`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `praise_treads` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `praise_tread_object_id` int(11) DEFAULT NULL,
  `praise_tread_object_type` varchar(255) DEFAULT NULL,
  `praise_or_tread` int(11) DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `praise_tread` (`praise_tread_object_id`,`praise_tread_object_type`)
) ENGINE=InnoDB AUTO_INCREMENT=46265 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `principal_activities`
--

DROP TABLE IF EXISTS `principal_activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `principal_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `principal_id` int(11) DEFAULT NULL,
  `principal_act_id` int(11) DEFAULT NULL,
  `principal_act_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=116954 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `private_messages`
--

DROP TABLE IF EXISTS `private_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `private_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `target_id` int(11) DEFAULT NULL,
  `sender_id` int(11) DEFAULT NULL,
  `receiver_id` int(11) DEFAULT NULL,
  `content` text,
  `send_time` datetime DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_private_messages_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25371 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `professional_levels`
--

DROP TABLE IF EXISTS `professional_levels`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `professional_levels` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `level` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `project_infos`
--

DROP TABLE IF EXISTS `project_infos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_infos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6561 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `project_package_applies`
--

DROP TABLE IF EXISTS `project_package_applies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_package_applies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_package_id` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `refused_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_project_package_applies_on_project_package_id` (`project_package_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `project_package_categories`
--

DROP TABLE IF EXISTS `project_package_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_package_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `project_packages`
--

DROP TABLE IF EXISTS `project_packages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_packages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `creator_id` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `content` text,
  `contact_name` varchar(255) DEFAULT NULL,
  `contact_phone` varchar(255) DEFAULT NULL,
  `min_price` decimal(10,0) DEFAULT NULL,
  `max_price` decimal(10,0) DEFAULT NULL,
  `visit_count` int(11) DEFAULT '0',
  `bidding_users_count` int(11) DEFAULT '0',
  `deadline_at` datetime DEFAULT NULL,
  `published_at` datetime DEFAULT NULL,
  `bidding_finished_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `project_package_category_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_project_packages_on_published_at` (`published_at`),
  KEY `index_project_packages_on_creator_id` (`creator_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `project_scores`
--

DROP TABLE IF EXISTS `project_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` varchar(255) DEFAULT NULL,
  `score` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `issue_num` int(11) DEFAULT '0',
  `issue_journal_num` int(11) DEFAULT '0',
  `news_num` int(11) DEFAULT '0',
  `documents_num` int(11) DEFAULT '0',
  `changeset_num` int(11) DEFAULT '0',
  `board_message_num` int(11) DEFAULT '0',
  `board_num` int(11) DEFAULT '0',
  `attach_num` int(11) DEFAULT '0',
  `commit_time` datetime DEFAULT NULL,
  `pull_request_num` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4390 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `project_statuses`
--

DROP TABLE IF EXISTS `project_statuses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_statuses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `changesets_count` int(11) DEFAULT NULL,
  `watchers_count` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `project_type` int(11) DEFAULT NULL,
  `grade` float DEFAULT '0',
  `course_ac_para` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_project_statuses_on_grade` (`grade`)
) ENGINE=InnoDB AUTO_INCREMENT=3681 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `projecting_softapplictions`
--

DROP TABLE IF EXISTS `projecting_softapplictions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `projecting_softapplictions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `softapplication_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `projects`
--

DROP TABLE IF EXISTS `projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `description` text,
  `homepage` varchar(255) DEFAULT '',
  `is_public` tinyint(1) NOT NULL DEFAULT '1',
  `parent_id` int(11) DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `updated_on` datetime DEFAULT NULL,
  `identifier` varchar(255) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT '1',
  `lft` int(11) DEFAULT NULL,
  `rgt` int(11) DEFAULT NULL,
  `inherit_members` tinyint(1) NOT NULL DEFAULT '0',
  `project_type` int(11) DEFAULT NULL,
  `hidden_repo` tinyint(1) NOT NULL DEFAULT '0',
  `attachmenttype` int(11) DEFAULT '1',
  `user_id` int(11) DEFAULT NULL,
  `dts_test` int(11) DEFAULT '0',
  `enterprise_name` varchar(255) DEFAULT NULL,
  `organization_id` int(11) DEFAULT NULL,
  `project_new_type` int(11) DEFAULT NULL,
  `gpid` int(11) DEFAULT NULL,
  `forked_from_project_id` int(11) DEFAULT NULL,
  `forked_count` int(11) DEFAULT NULL,
  `publish_resource` int(11) DEFAULT '0',
  `visits` int(11) DEFAULT '0',
  `hot` int(11) DEFAULT '0',
  `invite_code` varchar(255) DEFAULT NULL,
  `qrcode` varchar(255) DEFAULT NULL,
  `qrcode_expiretime` int(11) DEFAULT '0',
  `script` text,
  `training_status` tinyint(4) DEFAULT '0',
  `rep_identifier` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_projects_on_lft` (`lft`),
  KEY `index_projects_on_rgt` (`rgt`)
) ENGINE=InnoDB AUTO_INCREMENT=4505 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `projects_trackers`
--

DROP TABLE IF EXISTS `projects_trackers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `projects_trackers` (
  `project_id` int(11) NOT NULL DEFAULT '0',
  `tracker_id` int(11) NOT NULL DEFAULT '0',
  UNIQUE KEY `projects_trackers_unique` (`project_id`,`tracker_id`),
  KEY `projects_trackers_project_id` (`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `pull_requests`
--

DROP TABLE IF EXISTS `pull_requests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pull_requests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pull_request_id` int(11) DEFAULT NULL,
  `gpid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` int(11) DEFAULT '0',
  `project_id` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=312 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `quality_analyses`
--

DROP TABLE IF EXISTS `quality_analyses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `quality_analyses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `author_login` varchar(255) DEFAULT NULL,
  `rep_identifier` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `sonar_version` int(11) DEFAULT '0',
  `path` varchar(255) DEFAULT NULL,
  `branch` varchar(255) DEFAULT NULL,
  `language` varchar(255) DEFAULT NULL,
  `sonar_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=237 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `queries`
--

DROP TABLE IF EXISTS `queries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `queries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `name` varchar(255) NOT NULL DEFAULT '',
  `filters` text,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `is_public` tinyint(1) NOT NULL DEFAULT '0',
  `column_names` text,
  `sort_criteria` text,
  `group_by` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_queries_on_project_id` (`project_id`),
  KEY `index_queries_on_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `question_banks`
--

DROP TABLE IF EXISTS `question_banks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `question_banks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `quotes` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT NULL,
  `course_list_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3053 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `reference_materials`
--

DROP TABLE IF EXISTS `reference_materials`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `reference_materials` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `book` varchar(255) DEFAULT NULL,
  `editor` varchar(255) DEFAULT NULL,
  `press` varchar(255) DEFAULT NULL,
  `syllabus_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_reference_materials_on_syllabus_id` (`syllabus_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `relationships`
--

DROP TABLE IF EXISTS `relationships`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `relationships` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `follower_id` int(11) DEFAULT NULL,
  `followed_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_relationships_on_follower_id_and_followed_id` (`follower_id`,`followed_id`),
  KEY `index_relationships_on_followed_id` (`followed_id`),
  KEY `index_relationships_on_follower_id` (`follower_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `relative_memo_to_open_source_projects`
--

DROP TABLE IF EXISTS `relative_memo_to_open_source_projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `relative_memo_to_open_source_projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `osp_id` int(11) DEFAULT NULL,
  `relative_memo_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=596992 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `relative_memos`
--

DROP TABLE IF EXISTS `relative_memos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `relative_memos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `osp_id` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `content` mediumtext NOT NULL,
  `author_id` int(11) DEFAULT NULL,
  `replies_count` int(11) DEFAULT '0',
  `last_reply_id` int(11) DEFAULT NULL,
  `lock` tinyint(1) DEFAULT '0',
  `sticky` tinyint(1) DEFAULT '0',
  `is_quote` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `viewed_count_crawl` int(11) DEFAULT '0',
  `viewed_count_local` int(11) DEFAULT '0',
  `url` varchar(255) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `userhomeurl` varchar(255) DEFAULT NULL,
  `date_collected` date DEFAULT NULL,
  `topic_resource` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=451234 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rep_statics`
--

DROP TABLE IF EXISTS `rep_statics`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rep_statics` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `commits_num` int(11) DEFAULT NULL,
  `uname` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `add` int(11) DEFAULT NULL,
  `del` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `changeset` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1717 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `repertoires`
--

DROP TABLE IF EXISTS `repertoires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `repertoires` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `repositories`
--

DROP TABLE IF EXISTS `repositories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `repositories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `url` varchar(255) NOT NULL DEFAULT '',
  `login` varchar(60) DEFAULT '',
  `password` varchar(255) DEFAULT '',
  `root_url` varchar(255) DEFAULT '',
  `type` varchar(255) DEFAULT NULL,
  `path_encoding` varchar(64) DEFAULT NULL,
  `log_encoding` varchar(64) DEFAULT NULL,
  `extra_info` text,
  `identifier` varchar(255) DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT '0',
  `hidden` tinyint(1) DEFAULT '0',
  `shixun_id` int(11) DEFAULT NULL,
  `myshixun_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_repositories_on_project_id` (`project_id`)
) ENGINE=InnoDB AUTO_INCREMENT=78188 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `resource_banks`
--

DROP TABLE IF EXISTS `resource_banks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `resource_banks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) DEFAULT NULL,
  `attachment_id` int(11) DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `disk_filename` varchar(255) DEFAULT NULL,
  `filesize` int(11) DEFAULT NULL,
  `digest` varchar(255) DEFAULT NULL,
  `downloads` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `description` text,
  `disk_directory` varchar(255) DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT NULL,
  `copy_from` int(11) DEFAULT NULL,
  `quotes` int(11) DEFAULT NULL,
  `applicable_syllabus` varchar(255) DEFAULT NULL,
  `major_level` int(11) DEFAULT NULL,
  `discipline_category_id` int(11) DEFAULT NULL,
  `first_level_discipline_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `content_type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_resource_banks_on_course_id` (`course_id`),
  KEY `index_resource_banks_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11222 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rich_rich_files`
--

DROP TABLE IF EXISTS `rich_rich_files`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rich_rich_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `rich_file_file_name` varchar(255) DEFAULT NULL,
  `rich_file_content_type` varchar(255) DEFAULT NULL,
  `rich_file_file_size` int(11) DEFAULT NULL,
  `rich_file_updated_at` datetime DEFAULT NULL,
  `owner_type` varchar(255) DEFAULT NULL,
  `owner_id` int(11) DEFAULT NULL,
  `uri_cache` text,
  `simplified_type` varchar(255) DEFAULT 'file',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `roles`
--

DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL DEFAULT '',
  `position` int(11) DEFAULT '1',
  `assignable` tinyint(1) DEFAULT '1',
  `builtin` int(11) NOT NULL DEFAULT '0',
  `permissions` text,
  `issues_visibility` varchar(30) NOT NULL DEFAULT 'default',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `run_code_messages`
--

DROP TABLE IF EXISTS `run_code_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `run_code_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `status` int(11) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `game_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_run_code_messages_on_game_id` (`game_id`)
) ENGINE=InnoDB AUTO_INCREMENT=640417 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `schema_migrations`
--

DROP TABLE IF EXISTS `schema_migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `schema_migrations` (
  `version` varchar(255) NOT NULL,
  UNIQUE KEY `unique_schema_migrations` (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `school_daily_active_users`
--

DROP TABLE IF EXISTS `school_daily_active_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `school_daily_active_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `school_daily_report_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_school_daily_active_users_on_school_daily_report_id` (`school_daily_report_id`)
) ENGINE=InnoDB AUTO_INCREMENT=127360 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `school_daily_reports`
--

DROP TABLE IF EXISTS `school_daily_reports`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `school_daily_reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `school_id` int(11) DEFAULT NULL,
  `school_name` varchar(255) DEFAULT NULL,
  `teacher_increase_count` int(11) DEFAULT NULL,
  `student_increase_count` int(11) DEFAULT NULL,
  `course_increase_count` int(11) DEFAULT NULL,
  `shixun_increase_count` int(11) DEFAULT NULL,
  `active_user_count` int(11) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `shixun_homework_count` int(11) DEFAULT '0',
  `shixun_evaluate_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_school_daily_reports_on_school_id_and_date` (`school_id`,`date`),
  KEY `index_school_daily_reports_on_date_and_teacher_increase_count` (`date`,`teacher_increase_count`),
  KEY `index_school_daily_reports_on_date_and_student_increase_count` (`date`,`student_increase_count`),
  KEY `index_school_daily_reports_on_date_and_course_increase_count` (`date`,`course_increase_count`),
  KEY `index_school_daily_reports_on_date_and_shixun_increase_count` (`date`,`shixun_increase_count`),
  KEY `index_school_daily_reports_on_date_and_active_user_count` (`date`,`active_user_count`)
) ENGINE=InnoDB AUTO_INCREMENT=2161807 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `school_images`
--

DROP TABLE IF EXISTS `school_images`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `school_images` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `link` varchar(255) DEFAULT NULL,
  `status` tinyint(1) DEFAULT '0',
  `school_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `school_reports`
--

DROP TABLE IF EXISTS `school_reports`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `school_reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `school_id` int(11) DEFAULT NULL,
  `school_name` varchar(255) DEFAULT NULL,
  `shixun_evaluate_count` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_school_reports_on_school_id` (`school_id`),
  KEY `index_school_reports_on_shixun_evaluate_count` (`shixun_evaluate_count`)
) ENGINE=InnoDB AUTO_INCREMENT=2887 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `schools`
--

DROP TABLE IF EXISTS `schools`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `schools` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `logo_link` varchar(255) DEFAULT NULL,
  `pinyin` varchar(255) DEFAULT NULL,
  `school_type` int(11) DEFAULT '0',
  `city` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `auto_users_trial` tinyint(1) DEFAULT '0',
  `shool_code` varchar(255) DEFAULT NULL,
  `authorization_time` datetime DEFAULT NULL,
  `ec_auth` tinyint(4) DEFAULT '0',
  `identifier` varchar(255) DEFAULT NULL,
  `is_online` tinyint(1) DEFAULT '0',
  `video_name` varchar(255) DEFAULT NULL,
  `video_desc` varchar(255) DEFAULT NULL,
  `course_link` varchar(255) DEFAULT NULL,
  `course_name` varchar(255) DEFAULT NULL,
  `partner_id` int(11) DEFAULT NULL,
  `customer_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_schools_on_identifier` (`identifier`),
  KEY `index_schools_on_partner_id` (`partner_id`),
  KEY `index_schools_on_customer_id` (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3438 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `score_indicator_qualities`
--

DROP TABLE IF EXISTS `score_indicator_qualities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `score_indicator_qualities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `upper_limit` float DEFAULT NULL,
  `lower_limit` float DEFAULT NULL,
  `score_set_id` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `score_indicators`
--

DROP TABLE IF EXISTS `score_indicators`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `score_indicators` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `score_set_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `scale` float DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `score_quality_descriptions`
--

DROP TABLE IF EXISTS `score_quality_descriptions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `score_quality_descriptions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `score_indicator_id` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `score_sets`
--

DROP TABLE IF EXISTS `score_sets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `score_sets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `secdomains`
--

DROP TABLE IF EXISTS `secdomains`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `secdomains` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sub_type` int(11) DEFAULT NULL,
  `subname` varchar(255) DEFAULT NULL,
  `pid` int(11) DEFAULT '0',
  `desc` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `seems_rateable_cached_ratings`
--

DROP TABLE IF EXISTS `seems_rateable_cached_ratings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `seems_rateable_cached_ratings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cacheable_id` bigint(20) DEFAULT NULL,
  `cacheable_type` varchar(255) DEFAULT NULL,
  `avg` float NOT NULL,
  `cnt` int(11) NOT NULL,
  `dimension` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3294 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `seems_rateable_rates`
--

DROP TABLE IF EXISTS `seems_rateable_rates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `seems_rateable_rates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rater_id` bigint(20) DEFAULT NULL,
  `rateable_id` int(11) DEFAULT NULL,
  `rateable_type` varchar(255) DEFAULT NULL,
  `stars` float NOT NULL,
  `dimension` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `is_teacher_score` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21336 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `settings`
--

DROP TABLE IF EXISTS `settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `value` text,
  `updated_on` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_settings_on_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=78 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shares`
--

DROP TABLE IF EXISTS `shares`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shares` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_on` date DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `share_type` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `project_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shield_activities`
--

DROP TABLE IF EXISTS `shield_activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shield_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `container_type` varchar(255) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `shield_type` varchar(255) DEFAULT NULL,
  `shield_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=153 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shield_wechat_messages`
--

DROP TABLE IF EXISTS `shield_wechat_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shield_wechat_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `shield_id` int(11) DEFAULT NULL,
  `shield_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_infos`
--

DROP TABLE IF EXISTS `shixun_infos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_infos` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `propaedeutics` longtext,
  `description` longtext,
  `evaluate_script` longtext,
  `shixun_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_shixun_infos_on_shixun_id` (`shixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2858 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_major_courses`
--

DROP TABLE IF EXISTS `shixun_major_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_major_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `course_list_id` int(11) DEFAULT NULL,
  `major_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_shixun_major_courses_on_shixun_id` (`shixun_id`),
  KEY `index_shixun_major_courses_on_major_id` (`major_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4385 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_members`
--

DROP TABLE IF EXISTS `shixun_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `role` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_shixun_members_on_shixun_id` (`shixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5494 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_mirror_repositories`
--

DROP TABLE IF EXISTS `shixun_mirror_repositories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_mirror_repositories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `mirror_repository_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_shixun_mirror_repositories_on_shixun_id` (`shixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15027 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_modifies`
--

DROP TABLE IF EXISTS `shixun_modifies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_modifies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `myshixun_id` int(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `shixun_id_myshixun_id` (`shixun_id`,`myshixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8504 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_ports`
--

DROP TABLE IF EXISTS `shixun_ports`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_ports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_schools`
--

DROP TABLE IF EXISTS `shixun_schools`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_schools` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_shixun_schools_on_shixun_id` (`shixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=685 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_service_configs`
--

DROP TABLE IF EXISTS `shixun_service_configs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_service_configs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `cpu_limit` int(11) DEFAULT '1',
  `memory_limit` int(11) DEFAULT '1024',
  `request_limit` int(11) DEFAULT '10',
  `lower_cpu_limit` float DEFAULT '0.1',
  `resource_limit` int(11) DEFAULT '10000',
  `mirror_repository_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `shixun_id_mirror_id_unique` (`shixun_id`,`mirror_repository_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4468 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixun_tag_repertoires`
--

DROP TABLE IF EXISTS `shixun_tag_repertoires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixun_tag_repertoires` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shixun_id` int(11) DEFAULT NULL,
  `tag_repertoire_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `shixun_id_tag_repertoire_id` (`shixun_id`,`tag_repertoire_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2988 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shixuns`
--

DROP TABLE IF EXISTS `shixuns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shixuns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `gpid` int(11) DEFAULT NULL,
  `visits` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` int(11) DEFAULT '0',
  `language` varchar(255) DEFAULT NULL,
  `authentication` tinyint(1) DEFAULT '0',
  `identifier` varchar(255) DEFAULT NULL,
  `trainee` int(11) DEFAULT '1',
  `major_id` int(11) DEFAULT NULL,
  `webssh` int(11) DEFAULT '0',
  `homepage_show` tinyint(1) DEFAULT '0',
  `hidden` tinyint(1) DEFAULT '0',
  `fork_from` int(11) DEFAULT NULL,
  `can_copy` tinyint(1) DEFAULT '0',
  `modify_time` datetime DEFAULT NULL,
  `reset_time` datetime DEFAULT NULL,
  `publish_time` datetime DEFAULT NULL,
  `closer_id` int(11) DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `git_url` varchar(255) DEFAULT NULL,
  `vnc` tinyint(1) DEFAULT '0',
  `myshixuns_count` int(11) DEFAULT '0',
  `challenges_count` int(11) DEFAULT '0',
  `use_scope` tinyint(4) DEFAULT '0',
  `mirror_script_id` int(11) DEFAULT NULL,
  `image_text` varchar(60) DEFAULT NULL,
  `code_hidden` tinyint(1) DEFAULT '0',
  `task_pass` tinyint(1) DEFAULT '0',
  `exec_time` int(11) DEFAULT '20',
  `test_set_permission` tinyint(1) DEFAULT '1',
  `sigle_training` tinyint(1) DEFAULT '0',
  `hide_code` tinyint(1) DEFAULT '0',
  `multi_webssh` tinyint(1) DEFAULT '0',
  `excute_time` int(11) DEFAULT NULL,
  `repo_name` varchar(255) DEFAULT NULL,
  `averge_star` float DEFAULT '5',
  `opening_time` datetime DEFAULT NULL,
  `users_count` int(11) DEFAULT '0',
  `forbid_copy` tinyint(1) DEFAULT '0',
  `pod_life` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_shixuns_on_identifier` (`identifier`),
  KEY `index_shixuns_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3273 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `softapplications`
--

DROP TABLE IF EXISTS `softapplications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `softapplications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `app_type_id` int(11) DEFAULT NULL,
  `app_type_name` varchar(255) DEFAULT NULL,
  `android_min_version_available` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `contest_id` int(11) DEFAULT NULL,
  `softapplication_id` int(11) DEFAULT NULL,
  `is_public` int(11) DEFAULT NULL,
  `application_developers` varchar(255) DEFAULT NULL,
  `deposit_project_url` varchar(255) DEFAULT NULL,
  `deposit_project` varchar(255) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sonar_errors`
--

DROP TABLE IF EXISTS `sonar_errors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sonar_errors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `jenkins_job_name` varchar(255) DEFAULT NULL,
  `output` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ssos`
--

DROP TABLE IF EXISTS `ssos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ssos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `sex` int(11) DEFAULT NULL,
  `school` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_ssos_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `stage_shixuns`
--

DROP TABLE IF EXISTS `stage_shixuns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stage_shixuns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject_id` int(11) DEFAULT NULL,
  `stage_id` int(11) DEFAULT NULL,
  `shixun_id` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_stage_shixuns_on_subject_id` (`subject_id`),
  KEY `index_stage_shixuns_on_stage_id` (`stage_id`),
  KEY `index_stage_shixuns_on_shixun_id` (`shixun_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7936 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `stages`
--

DROP TABLE IF EXISTS `stages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `user_id` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `shixuns_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_stages_on_subject_id` (`subject_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1013 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `statistic_scores`
--

DROP TABLE IF EXISTS `statistic_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `statistic_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `score` float DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `base_score` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `statistics`
--

DROP TABLE IF EXISTS `statistics`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `statistics` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `score` float DEFAULT '1',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `student_graduation_topics`
--

DROP TABLE IF EXISTS `student_graduation_topics`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student_graduation_topics` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `graduation_topic_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `member_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `course_member_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_student_graduation_topics_on_user_id` (`user_id`),
  KEY `index_student_graduation_topics_on_graduation_topic_id` (`graduation_topic_id`),
  KEY `index_student_graduation_topics_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=247 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `student_work_projects`
--

DROP TABLE IF EXISTS `student_work_projects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student_work_projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `homework_common_id` int(11) DEFAULT NULL,
  `student_work_id` int(11) DEFAULT NULL,
  `project_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `is_leader` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `course_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_student_work_projects_on_homework_common_id` (`homework_common_id`),
  KEY `index_student_work_projects_on_user_id` (`user_id`),
  KEY `index_student_work_projects_on_project_id` (`project_id`),
  KEY `index_student_work_projects_on_student_work_id` (`student_work_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4970 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `student_work_tests`
--

DROP TABLE IF EXISTS `student_work_tests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student_work_tests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `student_work_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` int(11) DEFAULT '9',
  `results` text,
  `src` text,
  PRIMARY KEY (`id`),
  KEY `index_student_work_tests_on_student_work_id` (`student_work_id`)
) ENGINE=InnoDB AUTO_INCREMENT=373663 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `student_works`
--

DROP TABLE IF EXISTS `student_works`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student_works` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` longtext,
  `homework_common_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `final_score` float DEFAULT NULL,
  `teacher_score` float DEFAULT NULL,
  `student_score` float DEFAULT NULL,
  `teaching_asistant_score` float DEFAULT NULL,
  `project_id` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `late_penalty` int(11) DEFAULT '0',
  `absence_penalty` int(11) DEFAULT '0',
  `system_score` float DEFAULT '0',
  `is_test` tinyint(1) DEFAULT '0',
  `simi_id` int(11) DEFAULT NULL,
  `simi_value` int(11) DEFAULT NULL,
  `work_score` float DEFAULT NULL,
  `work_status` int(11) DEFAULT '0',
  `commit_time` datetime DEFAULT NULL,
  `is_delete` int(11) DEFAULT '0',
  `appeal_penalty` int(11) DEFAULT '0',
  `re_commit` tinyint(1) DEFAULT '0',
  `late_reason` text,
  `group_id` int(11) DEFAULT '0',
  `myshixun_id` int(11) DEFAULT '0',
  `update_time` datetime DEFAULT NULL,
  `commit_user_id` int(11) DEFAULT NULL,
  `ultimate_score` tinyint(1) DEFAULT '0',
  `cost_time` int(11) DEFAULT '0',
  `compelete_status` int(11) DEFAULT '0',
  `efficiency` float DEFAULT '0',
  `eff_score` float DEFAULT '0',
  `calculation_time` datetime DEFAULT NULL,
  `update_user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_on_homework_common_id_user_id` (`homework_common_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2600150 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `student_works_evaluation_distributions`
--

DROP TABLE IF EXISTS `student_works_evaluation_distributions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student_works_evaluation_distributions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `student_work_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_student_works_evaluation_distributions_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=198064 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `student_works_scores`
--

DROP TABLE IF EXISTS `student_works_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student_works_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `student_work_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `score` float DEFAULT NULL,
  `comment` text,
  `reviewer_role` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `appeal_status` int(11) DEFAULT '0',
  `is_hidden` tinyint(1) DEFAULT '0',
  `is_ultimate` tinyint(1) DEFAULT '0',
  `is_invalid` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `student_work_id` (`student_work_id`)
) ENGINE=InnoDB AUTO_INCREMENT=215446 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `student_works_scores_appeals`
--

DROP TABLE IF EXISTS `student_works_scores_appeals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student_works_scores_appeals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `student_works_score_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `comment` text,
  `appeal_status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_student_works_scores_appeals_on_student_works_score_id` (`student_works_score_id`)
) ENGINE=InnoDB AUTO_INCREMENT=419 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `students_for_courses`
--

DROP TABLE IF EXISTS `students_for_courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `students_for_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `student_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_students_for_courses_on_student_id` (`student_id`),
  KEY `index_students_for_courses_on_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=114666 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sub_document_comments`
--

DROP TABLE IF EXISTS `sub_document_comments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sub_document_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content` text,
  `title` text,
  `sub_domain_id` int(11) DEFAULT NULL,
  `creator_id` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `reply_id` int(11) DEFAULT NULL,
  `locked` int(11) DEFAULT NULL,
  `sticky` int(11) DEFAULT NULL,
  `org_subfield_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sub_domains`
--

DROP TABLE IF EXISTS `sub_domains`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sub_domains` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `org_subfield_id` int(11) DEFAULT NULL,
  `priority` int(11) DEFAULT '0',
  `name` varchar(255) DEFAULT NULL,
  `field_type` varchar(255) DEFAULT NULL,
  `hide` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sub_repertoires`
--

DROP TABLE IF EXISTS `sub_repertoires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sub_repertoires` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `repertoire_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_sub_repertoires_on_repertoire_id` (`repertoire_id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `subfield_subdomain_dirs`
--

DROP TABLE IF EXISTS `subfield_subdomain_dirs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subfield_subdomain_dirs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `org_subfield_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `subject_level_systems`
--

DROP TABLE IF EXISTS `subject_level_systems`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subject_level_systems` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `level` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `subject_members`
--

DROP TABLE IF EXISTS `subject_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subject_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `role` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `position` int(11) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `index_subject_members_on_subject_id` (`subject_id`),
  KEY `index_subject_members_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=592 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `subjects`
--

DROP TABLE IF EXISTS `subjects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subjects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `user_id` int(11) DEFAULT NULL,
  `visits` int(11) DEFAULT '1',
  `status` int(11) DEFAULT '0',
  `course_list_id` int(11) DEFAULT NULL,
  `major_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `hidden` tinyint(1) DEFAULT '0',
  `learning_notes` text,
  `introduction` varchar(255) DEFAULT NULL,
  `stages_count` int(11) DEFAULT '0',
  `stage_shixuns_count` int(11) DEFAULT '0',
  `homepage_show` tinyint(1) DEFAULT '0',
  `repertoire_id` int(11) DEFAULT NULL,
  `score_count` int(11) DEFAULT NULL,
  `publish_time` datetime DEFAULT NULL,
  `shixuns_count` int(11) DEFAULT '0',
  `subject_level_system_id` int(11) DEFAULT NULL,
  `excellent` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_subjects_on_user_id` (`user_id`),
  KEY `index_subjects_on_course_list_id` (`course_list_id`),
  KEY `index_subjects_on_major_id` (`major_id`),
  KEY `index_subjects_on_subject_level_system_id` (`subject_level_system_id`)
) ENGINE=InnoDB AUTO_INCREMENT=388 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `syllabus_members`
--

DROP TABLE IF EXISTS `syllabus_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `syllabus_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rank` int(11) DEFAULT NULL,
  `syllabus_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_syllabus_members_on_syllabus_id` (`syllabus_id`),
  KEY `index_syllabus_members_on_user_id` (`user_id`),
  KEY `index_syllabus_members_on_rank` (`rank`)
) ENGINE=InnoDB AUTO_INCREMENT=1009 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `syllabus_update_records`
--

DROP TABLE IF EXISTS `syllabus_update_records`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `syllabus_update_records` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `syllabus_id` int(11) DEFAULT NULL,
  `property` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_syllabus_update_records_on_user_id` (`user_id`),
  KEY `index_syllabus_update_records_on_syllabus_id` (`syllabus_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `syllabuses`
--

DROP TABLE IF EXISTS `syllabuses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `syllabuses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `description` text,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `eng_name` varchar(255) DEFAULT NULL,
  `syllabus_type` int(11) DEFAULT NULL,
  `credit` int(11) DEFAULT NULL,
  `hours` int(11) DEFAULT NULL,
  `theory_hours` int(11) DEFAULT NULL,
  `practice_hours` int(11) DEFAULT NULL,
  `applicable_major` varchar(255) DEFAULT NULL,
  `pre_course` varchar(255) DEFAULT NULL,
  `visits` int(11) DEFAULT '0',
  `des_status` int(11) DEFAULT '0',
  `major_level` int(11) DEFAULT NULL,
  `discipline_category_id` int(11) DEFAULT NULL,
  `first_level_discipline_id` int(11) DEFAULT NULL,
  `major_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_syllabuses_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=997 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `system_messages`
--

DROP TABLE IF EXISTS `system_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `system_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `content` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `description` text,
  `subject` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `system_update_notices`
--

DROP TABLE IF EXISTS `system_update_notices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `system_update_notices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject` varchar(255) DEFAULT NULL,
  `notes` text,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `notice_type` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tag_repertoires`
--

DROP TABLE IF EXISTS `tag_repertoires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tag_repertoires` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `sub_repertoire_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=168 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `taggings`
--

DROP TABLE IF EXISTS `taggings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `taggings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tag_id` int(11) DEFAULT NULL,
  `taggable_id` int(11) DEFAULT NULL,
  `taggable_type` varchar(255) DEFAULT NULL,
  `tagger_id` int(11) DEFAULT NULL,
  `tagger_type` varchar(255) DEFAULT NULL,
  `context` varchar(128) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `taggings_idx` (`tag_id`,`taggable_id`,`taggable_type`,`context`,`tagger_id`,`tagger_type`),
  KEY `index_taggings_on_taggable_type` (`taggable_type`),
  KEY `index_taggings_on_taggable_id_and_taggable_type_and_context` (`taggable_id`,`taggable_type`,`context`),
  KEY `index_taggings_on_tag_id` (`tag_id`),
  KEY `index_taggings_on_taggable_id` (`taggable_id`),
  KEY `index_taggings_on_tagger_id` (`tagger_id`),
  KEY `index_taggings_on_context` (`context`),
  KEY `index_taggings_on_tagger_id_and_tagger_type` (`tagger_id`,`tagger_type`),
  KEY `taggings_idy` (`taggable_id`,`taggable_type`,`tagger_id`,`context`)
) ENGINE=InnoDB AUTO_INCREMENT=912150 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tags`
--

DROP TABLE IF EXISTS `tags`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tags` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `taggings_count` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=135816 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `teacher_course_groups`
--

DROP TABLE IF EXISTS `teacher_course_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `teacher_course_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) DEFAULT NULL,
  `course_group_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `course_member_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_teacher_course_groups_on_course_group_id` (`course_group_id`),
  KEY `index_teacher_course_groups_on_user_id` (`user_id`),
  KEY `index_teacher_course_groups_on_course_id` (`course_id`),
  KEY `index_teacher_course_groups_on_course_member_id` (`course_member_id`)
) ENGINE=InnoDB AUTO_INCREMENT=517 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `teachers`
--

DROP TABLE IF EXISTS `teachers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `teachers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tea_name` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `couurse_time` int(11) DEFAULT NULL,
  `course_code` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `extra` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `team_members`
--

DROP TABLE IF EXISTS `team_members`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `team_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `competition_team_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `role` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `competition_id` int(11) DEFAULT NULL,
  `is_teacher` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_team_members_on_competition_team_id` (`competition_team_id`),
  KEY `index_team_members_on_user_id` (`user_id`),
  KEY `index_team_members_on_competition_id` (`competition_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9119 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `test_sets`
--

DROP TABLE IF EXISTS `test_sets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `test_sets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `input` text,
  `output` text,
  `challenge_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `is_public` tinyint(1) DEFAULT '1',
  `result` tinyint(1) DEFAULT '1',
  `position` int(11) DEFAULT NULL,
  `score` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `testset` (`challenge_id`)
) ENGINE=InnoDB AUTO_INCREMENT=42670 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tidings`
--

DROP TABLE IF EXISTS `tidings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tidings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `trigger_user_id` int(11) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `parent_container_id` int(11) DEFAULT NULL,
  `parent_container_type` varchar(255) DEFAULT NULL,
  `belong_container_id` int(11) DEFAULT NULL,
  `belong_container_type` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `viewed` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `tiding_type` varchar(255) DEFAULT NULL,
  `extra` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_tidings_on_user_id` (`user_id`),
  KEY `index_tidings_on_container_id` (`container_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5452661 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `time_entries`
--

DROP TABLE IF EXISTS `time_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `time_entries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `issue_id` int(11) DEFAULT NULL,
  `hours` float NOT NULL,
  `comments` varchar(255) DEFAULT NULL,
  `activity_id` int(11) NOT NULL,
  `spent_on` date NOT NULL,
  `tyear` int(11) NOT NULL,
  `tmonth` int(11) NOT NULL,
  `tweek` int(11) NOT NULL,
  `created_on` datetime NOT NULL,
  `updated_on` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `time_entries_project_id` (`project_id`),
  KEY `time_entries_issue_id` (`issue_id`),
  KEY `index_time_entries_on_activity_id` (`activity_id`),
  KEY `index_time_entries_on_user_id` (`user_id`),
  KEY `index_time_entries_on_created_on` (`created_on`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tokens`
--

DROP TABLE IF EXISTS `tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tokens` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `action` varchar(30) NOT NULL DEFAULT '',
  `value` varchar(40) NOT NULL DEFAULT '',
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tokens_value` (`value`),
  KEY `index_tokens_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=176931 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `trackers`
--

DROP TABLE IF EXISTS `trackers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `trackers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL DEFAULT '',
  `is_in_chlog` tinyint(1) NOT NULL DEFAULT '0',
  `position` int(11) DEFAULT '1',
  `is_in_roadmap` tinyint(1) NOT NULL DEFAULT '1',
  `fields_bits` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `training_payinfos`
--

DROP TABLE IF EXISTS `training_payinfos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `training_payinfos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `invoice_title` varchar(255) DEFAULT NULL,
  `invoice_no` varchar(255) DEFAULT NULL,
  `invoice_content` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `training_id` int(11) DEFAULT NULL,
  `pay_type` int(11) DEFAULT NULL,
  `info` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `out_trade_no` varchar(255) DEFAULT NULL,
  `attachment_id` int(11) DEFAULT NULL,
  `num` int(11) NOT NULL DEFAULT '1',
  `fee` int(11) NOT NULL DEFAULT '2000',
  PRIMARY KEY (`id`),
  KEY `index_training_payinfos_on_training_id` (`training_id`)
) ENGINE=InnoDB AUTO_INCREMENT=178 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `training_tasks`
--

DROP TABLE IF EXISTS `training_tasks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `training_tasks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) DEFAULT NULL,
  `tracker_id` int(11) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `description` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `author_id` int(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT '0',
  `position` tinyint(4) DEFAULT '0',
  `result` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `trainings`
--

DROP TABLE IF EXISTS `trainings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `trainings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `sex` int(11) DEFAULT NULL,
  `school` varchar(255) DEFAULT NULL,
  `position` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `training_type` int(11) DEFAULT '1',
  `major` varchar(255) DEFAULT NULL,
  `student_id` varchar(255) DEFAULT NULL,
  `research_field` varchar(255) DEFAULT NULL,
  `job_title` varchar(255) DEFAULT NULL,
  `uncertified_major` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=422 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_actions`
--

DROP TABLE IF EXISTS `user_actions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_actions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `action_type` varchar(255) DEFAULT NULL,
  `action_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ip` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_actions_on_ip` (`ip`)
) ENGINE=InnoDB AUTO_INCREMENT=6168009 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_activities`
--

DROP TABLE IF EXISTS `user_activities`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `act_type` varchar(255) DEFAULT NULL,
  `act_id` int(11) DEFAULT NULL,
  `container_type` varchar(255) DEFAULT NULL,
  `container_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_act_index` (`act_id`,`act_type`,`container_id`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=207158 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_agents`
--

DROP TABLE IF EXISTS `user_agents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_agents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agent_type` varchar(255) DEFAULT NULL,
  `key` varchar(255) DEFAULT NULL,
  `ip` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `register_status` int(11) DEFAULT '0',
  `action_status` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_user_agents_on_ip` (`ip`)
) ENGINE=InnoDB AUTO_INCREMENT=1577 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_day_certifications`
--

DROP TABLE IF EXISTS `user_day_certifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_day_certifications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_day_certifications_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16189 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_extensions`
--

DROP TABLE IF EXISTS `user_extensions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_extensions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `birthday` date DEFAULT NULL,
  `brief_introduction` varchar(255) DEFAULT NULL,
  `gender` int(11) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `occupation` varchar(255) DEFAULT NULL,
  `work_experience` int(11) DEFAULT NULL,
  `zip_code` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `technical_title` varchar(255) DEFAULT NULL,
  `identity` int(11) DEFAULT NULL,
  `student_id` varchar(255) DEFAULT NULL,
  `teacher_realname` varchar(255) DEFAULT NULL,
  `student_realname` varchar(255) DEFAULT NULL,
  `location_city` varchar(255) DEFAULT NULL,
  `school_id` int(11) DEFAULT NULL,
  `description` varchar(255) DEFAULT '',
  `department_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_extensions_on_user_id` (`user_id`),
  KEY `index_user_extensions_on_school_id` (`school_id`),
  KEY `index_user_extensions_on_department_id` (`department_id`)
) ENGINE=InnoDB AUTO_INCREMENT=85865 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_feedback_messages`
--

DROP TABLE IF EXISTS `user_feedback_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_feedback_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `journals_for_message_id` int(11) DEFAULT NULL,
  `journals_for_message_type` varchar(255) DEFAULT NULL,
  `viewed` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_feedback_messages_on_user_id_and_created_at` (`user_id`,`created_at`),
  KEY `index_user_feedback_messages_on_journals_for_message_id` (`journals_for_message_id`)
) ENGINE=InnoDB AUTO_INCREMENT=30409 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_grades`
--

DROP TABLE IF EXISTS `user_grades`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_grades` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `grade` float DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_grades_on_grade` (`grade`),
  KEY `index_user_grades_on_project_id` (`project_id`),
  KEY `index_user_grades_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11020 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_hidden_modules`
--

DROP TABLE IF EXISTS `user_hidden_modules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_hidden_modules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `module_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_hidden_modules_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=26612 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_interests`
--

DROP TABLE IF EXISTS `user_interests`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_interests` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL,
  `repertoire_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_interests_on_user_id` (`user_id`),
  KEY `index_user_interests_on_repertoire_id` (`repertoire_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2579 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_levels`
--

DROP TABLE IF EXISTS `user_levels`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_levels` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `level` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12117 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_preferences`
--

DROP TABLE IF EXISTS `user_preferences`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_preferences` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `others` text,
  `hide_mail` tinyint(1) DEFAULT '0',
  `time_zone` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_preferences_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=82111 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_score_details`
--

DROP TABLE IF EXISTS `user_score_details`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_score_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `current_user_id` int(11) DEFAULT NULL,
  `target_user_id` int(11) DEFAULT NULL,
  `score_type` varchar(255) DEFAULT NULL,
  `score_action` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `old_score` int(11) DEFAULT NULL,
  `new_score` int(11) DEFAULT NULL,
  `current_user_level` int(11) DEFAULT NULL,
  `target_user_level` int(11) DEFAULT NULL,
  `score_changeable_obj_id` int(11) DEFAULT NULL,
  `score_changeable_obj_type` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=67274 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_scores`
--

DROP TABLE IF EXISTS `user_scores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `collaboration` int(11) DEFAULT NULL,
  `influence` int(11) DEFAULT NULL,
  `skill` int(11) DEFAULT NULL,
  `active` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12714 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_searches`
--

DROP TABLE IF EXISTS `user_searches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_searches` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `search_type` int(11) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_searches_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1446 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_sources`
--

DROP TABLE IF EXISTS `user_sources`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_sources` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `uuid` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_user_sources_on_type_and_uuid` (`type`,`uuid`),
  KEY `index_user_sources_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_statuses`
--

DROP TABLE IF EXISTS `user_statuses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_statuses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `changesets_count` int(11) DEFAULT NULL,
  `watchers_count` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `grade` float DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_user_statuses_on_changesets_count` (`changesets_count`),
  KEY `index_user_statuses_on_watchers_count` (`watchers_count`),
  KEY `index_user_statuses_on_grade` (`grade`)
) ENGINE=InnoDB AUTO_INCREMENT=82152 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_system_notices`
--

DROP TABLE IF EXISTS `user_system_notices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_system_notices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `notice_type` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_user_system_notices_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19173 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_wechats`
--

DROP TABLE IF EXISTS `user_wechats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_wechats` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subscribe` int(11) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `nickname` varchar(255) DEFAULT NULL,
  `sex` int(11) DEFAULT NULL,
  `language` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `province` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `headimgurl` varchar(255) DEFAULT NULL,
  `subscribe_time` varchar(255) DEFAULT NULL,
  `unionid` varchar(255) DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `groupid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `bindtype` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2424 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `login` varchar(255) NOT NULL DEFAULT '',
  `hashed_password` varchar(40) NOT NULL DEFAULT '',
  `firstname` varchar(30) NOT NULL DEFAULT '',
  `lastname` varchar(255) NOT NULL DEFAULT '',
  `mail` varchar(60) DEFAULT NULL,
  `admin` tinyint(1) NOT NULL DEFAULT '0',
  `status` int(11) NOT NULL DEFAULT '1',
  `last_login_on` datetime DEFAULT NULL,
  `language` varchar(5) DEFAULT '',
  `auth_source_id` int(11) DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `updated_on` datetime DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `identity_url` varchar(255) DEFAULT NULL,
  `mail_notification` varchar(255) NOT NULL DEFAULT '',
  `salt` varchar(64) DEFAULT NULL,
  `gid` int(11) DEFAULT NULL,
  `visits` int(11) DEFAULT '0',
  `excellent_teacher` int(11) DEFAULT '0',
  `excellent_student` int(11) DEFAULT '0',
  `phone` varchar(255) DEFAULT NULL,
  `authentication` tinyint(1) DEFAULT '0',
  `grade` int(11) DEFAULT '0',
  `experience` int(11) DEFAULT '0',
  `nickname` varchar(255) DEFAULT NULL,
  `show_realname` tinyint(1) DEFAULT '1',
  `professional_certification` tinyint(1) DEFAULT '0',
  `ID_number` varchar(255) DEFAULT NULL,
  `certification` int(11) DEFAULT '0',
  `homepage_teacher` tinyint(1) DEFAULT '0',
  `homepage_engineer` tinyint(1) DEFAULT '0',
  `is_test` tinyint(1) DEFAULT '0',
  `ecoder_user_id` int(11) DEFAULT '0',
  `partner_id` int(11) DEFAULT NULL,
  `business` tinyint(1) DEFAULT '0',
  `profile_completed` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_users_on_login` (`login`),
  UNIQUE KEY `index_users_on_mail` (`mail`),
  UNIQUE KEY `index_users_on_phone` (`phone`),
  KEY `index_users_on_homepage_engineer` (`homepage_engineer`),
  KEY `index_users_on_homepage_teacher` (`homepage_teacher`),
  KEY `index_users_on_ecoder_user_id` (`ecoder_user_id`),
  KEY `index_users_on_partner_id` (`partner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=86361 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `users_authentications`
--

DROP TABLE IF EXISTS `users_authentications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users_authentications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `authentication_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `verification_codes`
--

DROP TABLE IF EXISTS `verification_codes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `verification_codes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(255) DEFAULT NULL,
  `code_type` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `by_phone` (`phone`),
  KEY `by_email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=139423 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `versions`
--

DROP TABLE IF EXISTS `versions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `versions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `description` varchar(255) DEFAULT '',
  `effective_date` date DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `updated_on` datetime DEFAULT NULL,
  `wiki_page_title` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT 'open',
  `sharing` varchar(255) NOT NULL DEFAULT 'none',
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `versions_project_id` (`project_id`),
  KEY `index_versions_on_sharing` (`sharing`)
) ENGINE=InnoDB AUTO_INCREMENT=972 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `video_applies`
--

DROP TABLE IF EXISTS `video_applies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `video_applies` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `video_id` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_video_applies_on_video_id` (`video_id`)
) ENGINE=InnoDB AUTO_INCREMENT=196 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `videos`
--

DROP TABLE IF EXISTS `videos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `videos` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `uuid` varchar(255) DEFAULT NULL COMMENT 'Aliyun媒体ID',
  `cover_url` varchar(255) DEFAULT NULL COMMENT '视频封面',
  `file_url` varchar(255) DEFAULT NULL COMMENT '视频地址',
  `status` varchar(255) DEFAULT NULL,
  `vod_status` varchar(255) DEFAULT NULL COMMENT 'Aliyun媒体状态',
  `published_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `filesize` int(11) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_videos_on_uuid` (`uuid`),
  KEY `index_videos_on_user_id` (`user_id`),
  KEY `index_videos_on_published_at` (`published_at`)
) ENGINE=InnoDB AUTO_INCREMENT=719 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `visitors`
--

DROP TABLE IF EXISTS `visitors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `visitors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `master_id` int(11) DEFAULT NULL,
  `updated_on` datetime DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_visitors_user_id` (`user_id`),
  KEY `index_visitors_master_id` (`master_id`),
  KEY `index_visitors_updated_on` (`updated_on`)
) ENGINE=InnoDB AUTO_INCREMENT=143358 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `watchers`
--

DROP TABLE IF EXISTS `watchers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `watchers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `watchable_type` varchar(255) NOT NULL DEFAULT '',
  `watchable_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `watchers_user_id_type` (`user_id`,`watchable_type`),
  KEY `index_watchers_on_user_id` (`user_id`),
  KEY `index_watchers_on_watchable_id_and_watchable_type` (`watchable_id`,`watchable_type`)
) ENGINE=InnoDB AUTO_INCREMENT=50033 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `web_footer_companies`
--

DROP TABLE IF EXISTS `web_footer_companies`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `web_footer_companies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `logo_size` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `web_footer_oranizers`
--

DROP TABLE IF EXISTS `web_footer_oranizers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `web_footer_oranizers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `websshes`
--

DROP TABLE IF EXISTS `websshes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `websshes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `myshixun_id` int(11) DEFAULT NULL,
  `host` varchar(255) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wechat_logs`
--

DROP TABLE IF EXISTS `wechat_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wechat_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `openid` varchar(255) NOT NULL,
  `request_raw` text,
  `response_raw` text,
  `session_raw` text,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_wechat_logs_on_openid` (`openid`)
) ENGINE=InnoDB AUTO_INCREMENT=119051 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wechat_pays`
--

DROP TABLE IF EXISTS `wechat_pays`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wechat_pays` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `training_id` int(11) DEFAULT NULL,
  `appid` varchar(255) DEFAULT NULL,
  `bank_type` varchar(255) DEFAULT NULL,
  `cash_fee` varchar(255) DEFAULT NULL,
  `fee_type` varchar(255) DEFAULT NULL,
  `is_subscribe` varchar(255) DEFAULT NULL,
  `mch_id` varchar(255) DEFAULT NULL,
  `nonce_str` varchar(255) DEFAULT NULL,
  `openid` varchar(255) DEFAULT NULL,
  `out_trade_no` varchar(255) DEFAULT NULL,
  `result_code` varchar(255) DEFAULT NULL,
  `return_code` varchar(255) DEFAULT NULL,
  `time_end` varchar(255) DEFAULT NULL,
  `total_fee` varchar(255) DEFAULT NULL,
  `transaction_id` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_wechat_pays_on_transaction_id` (`transaction_id`),
  KEY `index_wechat_pays_on_training_id` (`training_id`)
) ENGINE=InnoDB AUTO_INCREMENT=191 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wiki_content_versions`
--

DROP TABLE IF EXISTS `wiki_content_versions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wiki_content_versions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `wiki_content_id` int(11) NOT NULL,
  `page_id` int(11) NOT NULL,
  `author_id` int(11) DEFAULT NULL,
  `data` longblob,
  `compression` varchar(6) DEFAULT '',
  `comments` varchar(255) DEFAULT '',
  `updated_on` datetime NOT NULL,
  `version` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `wiki_content_versions_wcid` (`wiki_content_id`),
  KEY `index_wiki_content_versions_on_updated_on` (`updated_on`)
) ENGINE=InnoDB AUTO_INCREMENT=264 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wiki_contents`
--

DROP TABLE IF EXISTS `wiki_contents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wiki_contents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `page_id` int(11) NOT NULL,
  `author_id` int(11) DEFAULT NULL,
  `text` longtext,
  `comments` varchar(255) DEFAULT '',
  `updated_on` datetime NOT NULL,
  `version` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `wiki_contents_page_id` (`page_id`),
  KEY `index_wiki_contents_on_author_id` (`author_id`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wiki_pages`
--

DROP TABLE IF EXISTS `wiki_pages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wiki_pages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `wiki_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `created_on` datetime NOT NULL,
  `protected` tinyint(1) NOT NULL DEFAULT '0',
  `parent_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `wiki_pages_wiki_id_title` (`wiki_id`,`title`),
  KEY `index_wiki_pages_on_wiki_id` (`wiki_id`),
  KEY `index_wiki_pages_on_parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wiki_redirects`
--

DROP TABLE IF EXISTS `wiki_redirects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wiki_redirects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `wiki_id` int(11) NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `redirects_to` varchar(255) DEFAULT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `wiki_redirects_wiki_id_title` (`wiki_id`,`title`),
  KEY `index_wiki_redirects_on_wiki_id` (`wiki_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wikis`
--

DROP TABLE IF EXISTS `wikis`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wikis` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL,
  `start_page` varchar(255) NOT NULL,
  `status` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `wikis_project_id` (`project_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2825 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `work_detail_groups`
--

DROP TABLE IF EXISTS `work_detail_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `work_detail_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `work_id` int(11) DEFAULT NULL,
  `min_num` int(11) DEFAULT NULL,
  `max_num` int(11) DEFAULT NULL,
  `base_on_project` tinyint(1) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_work_detail_groups_on_work_id` (`work_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `work_detail_manuals`
--

DROP TABLE IF EXISTS `work_detail_manuals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `work_detail_manuals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `evaluation_start` date DEFAULT NULL,
  `evaluation_end` date DEFAULT NULL,
  `evaluation_num` int(11) DEFAULT NULL,
  `work_id` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `index_work_detail_manuals_on_work_id` (`work_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `workflows`
--

DROP TABLE IF EXISTS `workflows`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `workflows` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tracker_id` int(11) NOT NULL DEFAULT '0',
  `old_status_id` int(11) NOT NULL DEFAULT '0',
  `new_status_id` int(11) NOT NULL DEFAULT '0',
  `role_id` int(11) NOT NULL DEFAULT '0',
  `assignee` tinyint(1) NOT NULL DEFAULT '0',
  `author` tinyint(1) NOT NULL DEFAULT '0',
  `type` varchar(30) DEFAULT NULL,
  `field_name` varchar(30) DEFAULT NULL,
  `rule` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `wkfs_role_tracker_old_status` (`role_id`,`tracker_id`,`old_status_id`),
  KEY `index_workflows_on_old_status_id` (`old_status_id`),
  KEY `index_workflows_on_role_id` (`role_id`),
  KEY `index_workflows_on_new_status_id` (`new_status_id`)
) ENGINE=InnoDB AUTO_INCREMENT=626 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `works`
--

DROP TABLE IF EXISTS `works`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `works` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `description` text,
  `publish_time` date DEFAULT NULL,
  `end_time` date DEFAULT NULL,
  `work_type` int(11) DEFAULT NULL,
  `contest_id` int(11) DEFAULT NULL,
  `is_delete` tinyint(1) DEFAULT '0',
  `score_open` tinyint(1) DEFAULT '0',
  `is_open` tinyint(1) DEFAULT '0',
  `work_status` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `online_evaluation` tinyint(1) DEFAULT '0',
  `score_valid` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `index_works_on_user_id` (`user_id`),
  KEY `index_works_on_contest_id` (`contest_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `works_categories`
--

DROP TABLE IF EXISTS `works_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `works_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `zip_packs`
--

DROP TABLE IF EXISTS `zip_packs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `zip_packs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `homework_id` int(11) DEFAULT NULL,
  `file_digest` varchar(255) DEFAULT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `pack_times` int(11) DEFAULT '1',
  `pack_size` int(11) DEFAULT '0',
  `file_digests` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `container_id` int(11) DEFAULT '0',
  `container_type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_zip_packs_on_container_id_and_container_type` (`container_id`,`container_type`)
) ENGINE=InnoDB AUTO_INCREMENT=45937 DEFAULT CHARSET=utf8;
/*!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 2019-08-28 16:31:29
