예제 #1
0
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'fullname' => array('type' => 'VARCHAR', 'constraint' => 255), 'email' => array('type' => 'VARCHAR', 'constraint' => 255), 'password' => array('type' => 'VARCHAR', 'constraint' => 40), 'language' => array('type' => 'VARCHAR', 'constraint' => 32)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->create_table('teachers');
     change_mysql_table_to_InnoDB('teachers');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'ip_addresses' => array('type' => 'text'), 'start_time' => array('type' => 'timestamp'), 'end_time' => array('type' => 'timestamp')));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->create_table('restrictions');
     change_mysql_table_to_InnoDB('restrictions');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255), 'parent_id' => array('type' => 'INT', 'constraint' => '11', 'null' => TRUE, 'unsigned' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('parent_id');
     $this->dbforge->create_table('categories');
     change_mysql_table_to_InnoDB('categories');
 }
예제 #4
0
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255), 'type' => array('type' => 'VARCHAR', 'constraint' => 255), 'subtype' => array('type' => 'VARCHAR', 'constraint' => 255), 'task_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'configuration' => array('type' => 'TEXT', 'null' => FALSE), 'enabled' => array('type' => 'INT', 'constraint' => 1, 'defalt' => 0)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('task_id');
     $this->dbforge->create_table('tests');
     change_mysql_table_to_InnoDB('tests');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'message' => array('type' => 'text'), 'ip_address' => array('type' => 'varchar', 'constraint' => '32'), 'language' => array('type' => 'varchar', 'constraint' => 64), 'log_type' => array('type' => 'int', 'constraint' => 5, 'unsigned' => TRUE), 'student_id' => array('type' => 'int', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE), 'teacher_id' => array('type' => 'int', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE), 'affected_table' => array('type' => 'varchar', 'constraint' => '255'), 'affected_row_primary_id' => array('type' => 'varchar', 'constraint' => '255'), 'additional_data' => array('type' => 'text')));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->create_table('logs');
     change_mysql_table_to_InnoDB('logs');
     $this->dbforge->add_column('solutions', array('ip_address' => array('type' => 'varchar', 'constraint' => '32')));
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'solution_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'version' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE), 'download_lock' => array('type' => 'int', 'constraint' => '1', 'unsigned' => TRUE, 'default' => 0), 'ip_address' => array('type' => 'varchar', 'constraint' => '32', 'null' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('solution_id');
     $this->dbforge->add_key('version');
     $this->dbforge->create_table('solution_versions');
     change_mysql_table_to_InnoDB('solution_versions');
 }
 public function up()
 {
     $this->dbforge->add_field(array('task_id' => array('type' => 'int', 'unsigned' => TRUE, 'null' => TRUE, 'constraint' => 11), 'student_id' => array('type' => 'int', 'unsigned' => TRUE, 'null' => TRUE, 'constraint' => 11), 'token' => array('type' => 'varchar', 'constraint' => 32), 'updated' => array('type' => 'timestamp'), 'score' => array('type' => 'int', 'unsigned' => TRUE, 'constraint' => 4), 'test_type' => array('type' => 'varchar', 'constraint' => 255)));
     $this->dbforge->add_key('task_id', TRUE);
     $this->dbforge->add_key('student_id', TRUE);
     $this->dbforge->add_key('token', TRUE);
     $this->dbforge->create_table('test_scores');
     change_mysql_table_to_InnoDB('test_scores');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'teacher_id' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE), 'widget_type' => array('type' => 'VARCHAR', 'constraint' => 255), 'widget_config' => array('type' => 'TEXT'), 'position' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE), 'column' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('teacher_id');
     $this->dbforge->create_table('admin_widgets');
     change_mysql_table_to_InnoDB('admin_widgets');
     $this->dbforge->add_column('teachers', array('widget_columns' => array('type' => 'INT', 'constraint' => 4, 'unsigned' => TRUE, 'default' => '1')));
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'student_id' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE), 'course_id' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE), 'group_id' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE), 'allowed' => array('type' => 'INT', 'constraint' => 1, 'unsigned' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('student_id');
     $this->dbforge->add_key('course_id');
     $this->dbforge->add_key('group_id');
     $this->dbforge->create_table('participants');
     change_mysql_table_to_InnoDB('participants');
 }
 public function up()
 {
     $this->dbforge->add_column('courses', array('allow_subscription_to' => array('type' => 'timestamp', 'null' => TRUE)));
     $this->dbforge->add_column('rooms', array('teachers_plain' => array('type' => 'text', 'null' => TRUE)));
     $this->dbforge->add_field(array('room_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'teacher_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE)));
     $this->dbforge->add_key('room_id');
     $this->dbforge->add_key('teacher_id');
     $this->dbforge->create_table('rooms_teachers_rel');
     change_mysql_table_to_InnoDB('rooms_teachers_rel');
 }
예제 #11
0
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'task_set_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'student_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'teacher_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'comment' => array('type' => 'TEXT', 'null' => TRUE), 'points' => array('type' => 'double', 'null' => TRUE), 'revalidate' => array('type' => 'int', 'constraint' => '1')));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('task_set_id');
     $this->dbforge->add_key('student_id');
     $this->dbforge->add_key('teacher_id');
     $this->dbforge->create_table('solutions');
     change_mysql_table_to_InnoDB('solutions');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'publish_start_time' => array('type' => 'timestamp', 'null' => TRUE), 'upload_end_time' => array('type' => 'timestamp', 'null' => TRUE), 'group_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'room_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'task_set_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'enabled' => array('type' => 'INT', 'constraint' => 1, 'defalt' => 0)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('task_set_id');
     $this->dbforge->add_key('group_id');
     $this->dbforge->add_key('room_id');
     $this->dbforge->create_table('task_set_permissions');
     change_mysql_table_to_InnoDB('task_set_permissions');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->create_table('task_set_types');
     change_mysql_table_to_InnoDB('task_set_types');
     $this->dbforge->add_field(array('course_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'task_set_type_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'upload_solution' => array('type' => 'INT', 'constraing' => '1', 'unsigned' => TRUE, 'default' => 1)));
     $this->dbforge->add_key('course_id');
     $this->dbforge->add_key('task_set_type_id');
     $this->dbforge->create_table('course_task_set_type_rel');
     change_mysql_table_to_InnoDB('course_task_set_type_rel');
 }
 public function up()
 {
     $this->dbforge->add_field(array('session_id' => array('type' => 'varchar', 'constraint' => '40', 'default' => '0', 'null' => FALSE), 'ip_address' => array('type' => 'varchar', 'constraint' => '45', 'default' => '0', 'null' => FALSE), 'user_agent' => array('type' => 'varchar', 'constraint' => '120', 'null' => FALSE), 'last_activity' => array('type' => 'int', 'constraint' => '10', 'unsigned' => TRUE, 'default' => 0, 'null' => FALSE), 'user_data' => array('type' => 'text', 'null' => FALSE)));
     $this->dbforge->add_key('session_id', TRUE);
     $this->dbforge->add_key('last_activity');
     $this->dbforge->create_table('sessions');
     change_mysql_table_to_InnoDB('sessions');
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'account_type' => array('type' => 'varchar', 'constraint' => '32'), 'account_email' => array('type' => 'varchar', 'constraint' => '255'), 'login_ip_address' => array('type' => 'varchar', 'constraint' => '32'), 'login_browser' => array('type' => 'varchar', 'constraint' => '255'), 'login_failed_time' => array('type' => 'timestamp')));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->create_table('security');
     change_mysql_table_to_InnoDB('security');
 }
 public function up()
 {
     $this->dbforge->add_column('task_sets', array('project_selection_deadline' => array('type' => 'timestamp', 'null' => TRUE)));
     $this->db->query('ALTER TABLE `task_sets` ADD `content_type` ENUM(\'task_set\', \'project\') NOT NULL DEFAULT \'task_set\' AFTER `created`;');
     $this->dbforge->add_column('task_task_set_rel', array('max_projects_selections' => array('type' => 'int', 'constraint' => 5, 'null' => TRUE, 'unsigned' => TRUE)));
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'student_id' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE), 'task_set_id' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE), 'task_id' => array('type' => 'INT', 'constraint' => 11, 'unsigned' => TRUE, 'null' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('student_id');
     $this->dbforge->add_key('task_set_id');
     $this->dbforge->add_key('task_id');
     $this->dbforge->create_table('project_selections');
     change_mysql_table_to_InnoDB('project_selections');
 }
 public function up()
 {
     change_mysql_table_to_InnoDB('lang_overlays');
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255), 'course_id' => array('type' => 'INT', 'constraint' => '11', 'null' => TRUE, 'unsigned' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('course_id');
     $this->dbforge->create_table('groups');
     change_mysql_table_to_InnoDB('groups');
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255), 'group_id' => array('type' => 'INT', 'constraint' => '11', 'null' => TRUE, 'unsigned' => TRUE), 'time_begin' => array('type' => 'INT', 'constraint' => 6, 'unsigned' => TRUE), 'time_end' => array('type' => 'INT', 'constraint' => 6, 'unsigned' => TRUE), 'time_day' => array('type' => 'INT', 'constraint' => 2, 'unsigned' => TRUE), 'capacity' => array('type' => 'INT', 'constraint' => 4, 'unsigned' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('group_id');
     $this->dbforge->create_table('rooms');
     change_mysql_table_to_InnoDB('rooms');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'text' => array('type' => 'text'), 'task_set_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'reply_at_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'student_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'teacher_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'approved' => array('type' => 'int', 'constraint' => '1', 'unsigned' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('task_set_id');
     $this->dbforge->add_key('reply_at_id');
     $this->dbforge->add_key('student_id');
     $this->dbforge->add_key('teacher_id');
     $this->dbforge->create_table('comments');
     change_mysql_table_to_InnoDB('comments');
     $this->dbforge->add_column('task_sets', array('comments_enabled' => array('type' => 'int', 'constraint' => 1, 'unsigned' => TRUE, 'default' => '1'), 'comments_moderated' => array('type' => 'int', 'constraint' => 1, 'unsigned' => TRUE, 'default' => '0')));
     $this->dbforge->add_field(array('comment_subscription_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'comment_subscriber_student_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'comment_subscriber_teacher_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE)));
     $this->dbforge->add_key('comment_subscription_id');
     $this->dbforge->add_key('comment_subscriber_student_id');
     $this->dbforge->add_key('comment_subscriber_teacher_id');
     $this->dbforge->create_table('task_set_comment_subscription_rel');
     change_mysql_table_to_InnoDB('task_set_comment_subscription_rel');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255), 'sorting' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->create_table('periods');
     change_mysql_table_to_InnoDB('periods');
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255), 'period_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'description' => array('type' => 'TEXT'), 'capacity' => array('type' => 'INT', 'unsigned' => TRUE, 'constraint' => 4), 'groups_change_deadline' => array('type' => 'timestamp', 'null' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('period_id');
     $this->dbforge->create_table('courses');
     change_mysql_table_to_InnoDB('courses');
     $this->dbforge->add_field(array('idiom' => array('type' => 'VARCHAR', 'constraint' => 32), 'constant' => array('type' => 'VARCHAR', 'constraint' => 255), 'text' => array('type' => 'TEXT')));
     $this->dbforge->add_key('idiom', TRUE);
     $this->dbforge->add_key('constant', TRUE);
     $this->dbforge->add_key('idiom');
     $this->dbforge->add_key('constant');
     $this->dbforge->create_table('translations');
     change_mysql_table_to_InnoDB('translations');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'start' => array('type' => 'timestamp'), 'exec_start' => array('type' => 'timestamp'), 'finish' => array('type' => 'timestamp'), 'test_type' => array('type' => 'varchar', 'constraint' => '64'), 'task_set_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'student_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'version' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE), 'task_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'teacher_id' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'priority' => array('type' => 'int', 'constraint' => '4', 'unsigned' => TRUE, 'default' => 2), 'original_priority' => array('type' => 'int', 'constraint' => '4', 'unsigned' => TRUE, 'default' => 2), 'worker' => array('type' => 'int', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'points' => array('type' => 'double'), 'bonus' => array('type' => 'double'), 'status' => array('type' => 'int', 'unsigned' => TRUE, 'constraint' => '4'), 'system_language' => array('type' => 'varchar', 'constraint' => '32')));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('task_set_id');
     $this->dbforge->add_key('student_id');
     $this->dbforge->add_key('task_id');
     $this->dbforge->add_key('teacher_id');
     $this->dbforge->add_key('priority');
     $this->dbforge->add_key('worker');
     $this->dbforge->create_table('tests_queue');
     change_mysql_table_to_InnoDB('tests_queue');
     $this->dbforge->add_column('task_sets', array('test_priority' => array('type' => 'int', 'constraint' => '4', 'unsigned' => TRUE, 'default' => 2)));
     $this->dbforge->add_field(array('test_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'test_queue_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'result' => array('type' => 'int', 'constraint' => '8', 'unsigned' => TRUE), 'result_text' => array('type' => 'text', 'null' => TRUE), 'percent_points' => array('type' => 'double'), 'percent_bonus' => array('type' => 'double'), 'points' => array('type' => 'double'), 'bonus' => array('type' => 'double')));
     $this->dbforge->add_key('test_id');
     $this->dbforge->add_key('test_queue_id');
     $this->dbforge->create_table('test_test_queue_rel');
     change_mysql_table_to_InnoDB('test_test_queue_rel');
 }
 public function up()
 {
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255), 'text' => array('type' => 'TEXT')));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->create_table('tasks');
     change_mysql_table_to_InnoDB('tasks');
     $this->dbforge->add_field(array('id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'auto_increment' => TRUE), 'updated' => array('type' => 'timestamp'), 'created' => array('type' => 'timestamp'), 'name' => array('type' => 'VARCHAR', 'constraint' => 255), 'course_id' => array('type' => 'INT', 'constraint' => '11', 'null' => TRUE, 'unsigned' => TRUE), 'task_set_type_id' => array('type' => 'INT', 'constraint' => '11', 'null' => TRUE, 'unsigned' => TRUE), 'published' => array('type' => 'INT', 'constraint' => 1, 'unsigned' => TRUE), 'publish_start_time' => array('type' => 'timestamp', 'null' => TRUE), 'upload_end_time' => array('type' => 'timestamp', 'null' => TRUE), 'group_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'room_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE)));
     $this->dbforge->add_key('id', TRUE);
     $this->dbforge->add_key('course_id');
     $this->dbforge->add_key('task_set_type_id');
     $this->dbforge->create_table('task_sets');
     change_mysql_table_to_InnoDB('task_sets');
     $this->dbforge->add_field(array('task_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'category_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE)));
     $this->dbforge->add_key('task_id');
     $this->dbforge->add_key('category_id');
     $this->dbforge->create_table('task_category_rel');
     change_mysql_table_to_InnoDB('task_category_rel');
     $this->dbforge->add_field(array('task_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'task_set_id' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE, 'null' => TRUE), 'points_total' => array('type' => 'DOUBLE'), 'sorting' => array('type' => 'INT', 'constraint' => '11', 'unsigned' => TRUE)));
     $this->dbforge->add_key('task_id');
     $this->dbforge->add_key('task_set_id');
     $this->dbforge->create_table('task_task_set_rel');
     change_mysql_table_to_InnoDB('task_task_set_rel');
 }