ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ilGlossaryDBUpdateSteps Class Reference
+ 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

Definition at line 21 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 25 of file class.ilGlossaryDBUpdateSteps.php.

References $db.

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

◆ step_1()

ilGlossaryDBUpdateSteps::step_1 ( )

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

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

◆ step_2()

ilGlossaryDBUpdateSteps::step_2 ( )

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

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

◆ step_3()

ilGlossaryDBUpdateSteps::step_3 ( )

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

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

◆ step_4()

ilGlossaryDBUpdateSteps::step_4 ( )

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

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

◆ step_5()

ilGlossaryDBUpdateSteps::step_5 ( )

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

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

◆ step_6()

ilGlossaryDBUpdateSteps::step_6 ( )

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

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

Field Documentation

◆ $db

ilDBInterface ilGlossaryDBUpdateSteps::$db
protected

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

Referenced by prepare().


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