ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestQuestionPool9DBUpdateSteps Class Reference
+ Inheritance diagram for ilTestQuestionPool9DBUpdateSteps:
+ Collaboration diagram for ilTestQuestionPool9DBUpdateSteps:

Public Member Functions

 prepare (ilDBInterface $db)
 
 step_1 ()
 
 step_2 ()
 
 step_3 ()
 
 step_4 ()
 
 step_5 ()
 
 step_6 ()
 
 step_7 ()
 
- Public Member Functions inherited from ilDatabaseUpdateSteps
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Definition at line 21 of file class.ilTestQuestionPool9DBUpdateSteps.php.

Member Function Documentation

◆ prepare()

ilTestQuestionPool9DBUpdateSteps::prepare ( ilDBInterface  $db)

Definition at line 25 of file class.ilTestQuestionPool9DBUpdateSteps.php.

References $db.

25  : void
26  {
27  $this->db = $db;
28  }

◆ step_1()

ilTestQuestionPool9DBUpdateSteps::step_1 ( )

Definition at line 30 of file class.ilTestQuestionPool9DBUpdateSteps.php.

30  : void
31  {
32  if ($this->db->tableColumnExists('qpl_questionpool', 'nav_taxonomy')) {
33  $this->db->dropTableColumn('qpl_questionpool', 'nav_taxonomy');
34  }
35  }

◆ step_2()

ilTestQuestionPool9DBUpdateSteps::step_2 ( )

Definition at line 37 of file class.ilTestQuestionPool9DBUpdateSteps.php.

37  : void
38  {
39  if ($this->db->tableColumnExists('qpl_questions', 'working_time')) {
40  $this->db->dropTableColumn('qpl_questions', 'working_time');
41  }
42  }

◆ step_3()

ilTestQuestionPool9DBUpdateSteps::step_3 ( )

Definition at line 44 of file class.ilTestQuestionPool9DBUpdateSteps.php.

44  : void
45  {
46  if ($this->db->tableExists('qpl_sol_sug')) {
47  $this->db->manipulateF("DELETE FROM qpl_sol_sug WHERE type = %s", ['text'], ['text']);
48  }
49  }

◆ step_4()

ilTestQuestionPool9DBUpdateSteps::step_4 ( )

Definition at line 51 of file class.ilTestQuestionPool9DBUpdateSteps.php.

References ilDBConstants\T_TEXT.

51  : void
52  {
53  $query = '
54  UPDATE object_data
55  INNER JOIN qpl_questionpool ON object_data.obj_id = qpl_questionpool.obj_fi
56  SET object_data.offline = IF(qpl_questionpool.isonline = 1, 0, 1)
57  WHERE object_data.type = %s
58  ';
59 
60  $this->db->manipulateF(
61  $query,
63  ['qpl']
64  );
65 
66  if ($this->db->tableColumnExists('qpl_questionpool', 'isonline')) {
67  $this->db->dropTableColumn('qpl_questionpool', 'isonline');
68  }
69  }

◆ step_5()

ilTestQuestionPool9DBUpdateSteps::step_5 ( )

Definition at line 71 of file class.ilTestQuestionPool9DBUpdateSteps.php.

71  : void
72  {
73  $this->db->modifyTableColumn(
74  'qpl_questions',
75  'author',
76  ['type' => 'text', 'length' => 512]
77  );
78  }

◆ step_6()

ilTestQuestionPool9DBUpdateSteps::step_6 ( )

Definition at line 80 of file class.ilTestQuestionPool9DBUpdateSteps.php.

80  : void
81  {
82  $this->db->modifyTableColumn(
83  'qpl_questions',
84  'title',
85  ['type' => 'text', 'length' => 124]
86  );
87  }

◆ step_7()

ilTestQuestionPool9DBUpdateSteps::step_7 ( )

Definition at line 89 of file class.ilTestQuestionPool9DBUpdateSteps.php.

References ilDBConstants\T_TEXT.

89  : void
90  {
91  $table = 'tst_rnd_quest_set_qpls';
92  $table_column = 'pool_title';
93  if ($this->db->tableColumnExists($table, $table_column)) {
94  $this->db->modifyTableColumn(
95  $table,
96  $table_column,
97  ['type' => ilDBConstants::T_TEXT, 'length' => 255],
98  );
99  }
100  }

Field Documentation

◆ $db

ilDBInterface ilTestQuestionPool9DBUpdateSteps::$db
protected

Definition at line 23 of file class.ilTestQuestionPool9DBUpdateSteps.php.

Referenced by prepare().


The documentation for this class was generated from the following file: