ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilGlossaryDBUpdateSteps Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilGlossaryDBUpdateSteps:
+ Collaboration diagram for ilGlossaryDBUpdateSteps:

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 ()
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 22 of file class.ilGlossaryDBUpdateSteps.php.

Member Function Documentation

◆ prepare()

ilGlossaryDBUpdateSteps::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 26 of file class.ilGlossaryDBUpdateSteps.php.

References $db.

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

◆ step_1()

ilGlossaryDBUpdateSteps::step_1 ( )

Definition at line 31 of file class.ilGlossaryDBUpdateSteps.php.

31  : void
32  {
33  if (!$this->db->tableColumnExists("glossary_term", "short_text")) {
34  $this->db->addTableColumn("glossary_term", "short_text", [
35  "type" => "text",
36  "length" => 4000,
37  "notnull" => false
38  ]);
39  }
40 
41  if (!$this->db->tableColumnExists("glossary_term", "short_text_dirty")) {
42  $this->db->addTableColumn("glossary_term", "short_text_dirty", [
43  "type" => "integer",
44  "notnull" => true,
45  "length" => 4,
46  "default" => 0
47  ]);
48  }
49  }

◆ step_2()

ilGlossaryDBUpdateSteps::step_2 ( )

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

51  : void
52  {
53  if (!$this->db->tableColumnExists("glossary_definition", "migration")) {
54  $this->db->addTableColumn("glossary_definition", "migration", [
55  "type" => "integer",
56  "notnull" => true,
57  "length" => 4,
58  "default" => 0
59  ]);
60  }
61  }

◆ step_3()

ilGlossaryDBUpdateSteps::step_3 ( )

Definition at line 63 of file class.ilGlossaryDBUpdateSteps.php.

63  : void
64  {
65  if (!$this->db->tableExists('glo_flashcard_term')) {
66  $fields = [
67  'term_id' => [
68  'type' => 'integer',
69  'length' => 4,
70  'notnull' => true,
71  'default' => 0
72  ],
73  'user_id' => [
74  'type' => 'integer',
75  'length' => 4,
76  'notnull' => true,
77  'default' => 0
78  ],
79  'glo_id' => [
80  'type' => 'integer',
81  'length' => 4,
82  'notnull' => true,
83  'default' => 0
84  ],
85  'last_access' => [
86  'type' => 'timestamp',
87  'notnull' => false
88  ],
89  'box_nr' => [
90  'type' => 'integer',
91  'length' => 4,
92  'notnull' => true,
93  'default' => 0
94  ]
95  ];
96  $this->db->createTable("glo_flashcard_term", $fields);
97  $this->db->addPrimaryKey("glo_flashcard_term", ["term_id", "user_id", "glo_id"]);
98  }
99  }

◆ step_4()

ilGlossaryDBUpdateSteps::step_4 ( )

Definition at line 101 of file class.ilGlossaryDBUpdateSteps.php.

101  : void
102  {
103  if (!$this->db->tableExists('glo_flashcard_box')) {
104  $fields = [
105  'box_nr' => [
106  'type' => 'integer',
107  'length' => 4,
108  'notnull' => true,
109  'default' => 0
110  ],
111  'user_id' => [
112  'type' => 'integer',
113  'length' => 4,
114  'notnull' => true,
115  'default' => 0
116  ],
117  'glo_id' => [
118  'type' => 'integer',
119  'length' => 4,
120  'notnull' => true,
121  'default' => 0
122  ],
123  'last_access' => [
124  'type' => 'timestamp',
125  'notnull' => false
126  ]
127  ];
128  $this->db->createTable("glo_flashcard_box", $fields);
129  $this->db->addPrimaryKey("glo_flashcard_box", ["box_nr", "user_id", "glo_id"]);
130  }
131  }

◆ step_5()

ilGlossaryDBUpdateSteps::step_5 ( )

Definition at line 133 of file class.ilGlossaryDBUpdateSteps.php.

133  : void
134  {
135  if (!$this->db->tableColumnExists("glossary", "flash_active")) {
136  $this->db->addTableColumn("glossary", "flash_active", [
137  "type" => "text",
138  "notnull" => true,
139  "length" => 1,
140  "default" => "n"
141  ]);
142  }
143 
144  if (!$this->db->tableColumnExists("glossary", "flash_mode")) {
145  $this->db->addTableColumn("glossary", "flash_mode", [
146  "type" => "text",
147  "notnull" => true,
148  "length" => 10,
149  "default" => "term"
150  ]);
151  }
152  }

◆ step_6()

ilGlossaryDBUpdateSteps::step_6 ( )

Definition at line 154 of file class.ilGlossaryDBUpdateSteps.php.

154  : void
155  {
156  if (!$this->db->tableExists('glossary_collection')) {
157  $fields = [
158  'id' => [
159  'type' => 'integer',
160  'length' => 4,
161  'notnull' => true,
162  'default' => 0
163  ],
164  'glo_id' => [
165  'type' => 'integer',
166  'length' => 4,
167  'notnull' => true,
168  'default' => 0
169  ]
170  ];
171  $this->db->createTable("glossary_collection", $fields);
172  $this->db->addPrimaryKey("glossary_collection", ["id", "glo_id"]);
173  }
174  }

Field Documentation

◆ $db

ilDBInterface ilGlossaryDBUpdateSteps::$db
protected

Definition at line 24 of file class.ilGlossaryDBUpdateSteps.php.

Referenced by prepare().


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