ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
DB100.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 class DB100 implements \ilDatabaseUpdateSteps
27 {
28  private ?\ilDBInterface $db = null;
29 
30  public function prepare(\ilDBInterface $db): void
31  {
32  $this->db = $db;
33  }
34 
35  public function step_1(): void
36  {
37  if ($this->db->tableExists('gs_footer_items')) {
38  $this->db->dropTable('gs_footer_items'); //
39  }
40  }
41 
42  public function step_2(): void
43  {
44  if ($this->db->tableExists('gs_footer_items')) {
45  return;
46  }
47  $this->db->createTable(
48  'gs_footer_items',
49  [
50  'id' => ['type' => 'text', 'length' => 255, 'notnull' => true],
51  'type' => ['type' => 'integer', 'length' => 1, 'notnull' => true],
52  'title' => ['type' => 'text', 'length' => 4000, 'notnull' => true],
53  'position' => ['type' => 'integer', 'length' => 4, 'notnull' => true],
54  'is_active' => ['type' => 'integer', 'length' => 1, 'notnull' => true],
55  'parent' => ['type' => 'text', 'length' => 255, 'notnull' => false],
56  'action' => ['type' => 'text', 'length' => 4000, 'notnull' => false],
57  'external' => ['type' => 'integer', 'length' => 1, 'notnull' => false],
58  'core' => ['type' => 'integer', 'length' => 1, 'notnull' => true],
59  ]
60  );
61  }
62 
63  public function step_3(): void
64  {
65  if ($this->db->tableExists('gs_item_translation')) {
66  return;
67  }
68  $this->db->createTable(
69  'gs_item_translation',
70  [
71  'id' => ['type' => 'text', 'length' => 255, 'notnull' => true],
72  'language_code' => ['type' => 'text', 'length' => 4, 'notnull' => true],
73  'translation' => ['type' => 'text', 'length' => 4000, 'notnull' => true],
74  'status' => ['type' => 'integer', 'length' => 1, 'notnull' => true, 'default' => 0],
75  ]
76  );
77  $this->db->addPrimaryKey('gs_item_translation', ['id', 'language_code']);
78  }
79 
80 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
Definition: DB100.php:30