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

Public Member Functions

 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 
 step_1 ()
 
 step_2 ()
 
 step_3 ()
 
 step_4 ()
 
 step_5 ()
 
 step_6 ()
 
 step_7 ()
 
 step_8 ()
 
 step_9 ()
 
 step_10 ()
 
 step_11 ()
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

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

Member Function Documentation

◆ prepare()

ilSkillDBUpdateSteps::prepare ( \ilDBInterface  $db)

Prepare the execution of the steps.

Do not use anything from the globals or the DIC inside your steps, only use the instance of the database provided here.

Implements ilDatabaseUpdateSteps.

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

References $db.

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

◆ step_1()

ilSkillDBUpdateSteps::step_1 ( )

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

30  : void
31  {
32  if ($this->db->sequenceExists('skl_self_eval')) {
33  $this->db->dropSequence('skl_self_eval');
34  }
35 
36  if ($this->db->tableExists('skl_self_eval')) {
37  $this->db->dropTable('skl_self_eval');
38  }
39 
40  if ($this->db->tableExists('skl_self_eval_level')) {
41  $this->db->dropTable('skl_self_eval_level');
42  }
43  }

◆ step_10()

ilSkillDBUpdateSteps::step_10 ( )

Definition at line 156 of file class.ilSkillDBUpdateSteps.php.

156  : void
157  {
158  if (!$this->db->tableColumnExists("skl_profile", "image_id")) {
159  $this->db->addTableColumn("skl_profile", "image_id", array(
160  "type" => "text",
161  "notnull" => true,
162  "length" => 4000
163  ));
164  }
165  }

◆ step_11()

ilSkillDBUpdateSteps::step_11 ( )

Definition at line 167 of file class.ilSkillDBUpdateSteps.php.

167  : void
168  {
169  if (!$this->db->tableExists("skl_profile_completion")) {
170  $fields = [
171  "profile_id" => [
172  "type" => "integer",
173  "length" => 4,
174  "notnull" => true
175  ],
176  "user_id" => [
177  "type" => "integer",
178  "length" => 4,
179  "notnull" => true
180  ],
181  "date" => [
182  "type" => "timestamp",
183  "notnull" => true
184  ],
185  "fulfilled" => [
186  "type" => "integer",
187  "length" => 1,
188  "notnull" => true
189  ]
190  ];
191  $this->db->createTable("skl_profile_completion", $fields);
192  $this->db->addPrimaryKey("skl_profile_completion", ["profile_id", "user_id", "date"]);
193  }
194  }

◆ step_2()

ilSkillDBUpdateSteps::step_2 ( )

Definition at line 45 of file class.ilSkillDBUpdateSteps.php.

45  : void
46  {
47  if (!$this->db->tableColumnExists('skl_user_skill_level', 'trigger_user_id')) {
48  $this->db->addTableColumn(
49  'skl_user_skill_level',
50  'trigger_user_id',
51  array(
52  'type' => 'text',
53  'notnull' => true,
54  'length' => 20,
55  'default' => "-"
56  )
57  );
58  }
59  }

◆ step_3()

ilSkillDBUpdateSteps::step_3 ( )

Definition at line 61 of file class.ilSkillDBUpdateSteps.php.

61  : void
62  {
63  if (!$this->db->tableColumnExists('skl_user_has_level', 'trigger_user_id')) {
64  $this->db->addTableColumn(
65  'skl_user_has_level',
66  'trigger_user_id',
67  array(
68  'type' => 'text',
69  'notnull' => true,
70  'length' => 20,
71  'default' => "-"
72  )
73  );
74  }
75  }

◆ step_4()

ilSkillDBUpdateSteps::step_4 ( )

Definition at line 77 of file class.ilSkillDBUpdateSteps.php.

77  : void
78  {
79  // moved to ilSkillSetupAgent using Objectives
80  }

◆ step_5()

ilSkillDBUpdateSteps::step_5 ( )

Definition at line 82 of file class.ilSkillDBUpdateSteps.php.

82  : void
83  {
84  // moved to ilSkillSetupAgent using Objectives
85  }

◆ step_6()

ilSkillDBUpdateSteps::step_6 ( )

Definition at line 87 of file class.ilSkillDBUpdateSteps.php.

87  : void
88  {
89  $this->db->update(
90  "object_data",
91  [
92  "title" => ["text", "Default"],
93  "description" => ["text", ""]
94  ],
95  [ // where
96  "type" => ["text", "skee"],
97  "title" => ["text", "Skill Tree"]
98  ]
99  );
100  }

◆ step_7()

ilSkillDBUpdateSteps::step_7 ( )

Definition at line 102 of file class.ilSkillDBUpdateSteps.php.

102  : void
103  {
104  $set = $this->db->queryF(
105  "SELECT * FROM object_data " .
106  " WHERE type = %s AND title = %s",
107  ["string", "string"],
108  ["skee", "Default"]
109  );
110  $rec = $this->db->fetchAssoc($set);
111 
112  $this->db->update(
113  "skl_tree",
114  [
115  "skl_tree_id" => ["integer", $rec["obj_id"]]
116  ],
117  [ // where
118  "skl_tree_id" => ["integer", 1]
119  ]
120  );
121  }

◆ step_8()

ilSkillDBUpdateSteps::step_8 ( )

Definition at line 123 of file class.ilSkillDBUpdateSteps.php.

123  : void
124  {
125  if (!$this->db->tableColumnExists("skl_profile", "skill_tree_id")) {
126  $this->db->addTableColumn("skl_profile", "skill_tree_id", array(
127  "type" => "integer",
128  "notnull" => true,
129  "default" => 0,
130  "length" => 4
131  ));
132  }
133  }

◆ step_9()

ilSkillDBUpdateSteps::step_9 ( )

Definition at line 135 of file class.ilSkillDBUpdateSteps.php.

135  : void
136  {
137  $set = $this->db->queryF(
138  "SELECT * FROM object_data " .
139  " WHERE type = %s AND title = %s",
140  ["string", "string"],
141  ["skee", "Default"]
142  );
143  $rec = $this->db->fetchAssoc($set);
144 
145  $this->db->update(
146  "skl_profile",
147  [
148  "skill_tree_id" => ["integer", $rec["obj_id"]]
149  ],
150  [ // where
151  "skill_tree_id" => ["integer", 0]
152  ]
153  );
154  }

Field Documentation

◆ $db

ilDBInterface ilSkillDBUpdateSteps::$db
protected

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

Referenced by prepare().


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