ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilWebResourceDBUpdateSteps.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
27  protected \ilDBInterface $db;
28 
29  public function prepare(\ilDBInterface $db): void
30  {
31  $this->db = $db;
32  }
33 
34  public function step_1(): void
35  {
36  // Add index
37  if (!$this->db->indexExistsByFields('webr_items', ['webr_id'])) {
38  $this->db->addIndex('webr_items', ['webr_id'], 'i3');
39  }
40  }
41 
42  public function step_2(): void
43  {
44  // Add combined index
45  // 32201
46  if (
47  $this->db->tableExists('webr_items') &&
48  !$this->db->indexExistsByFields('webr_items', ['webr_id', 'active'])
49  ) {
50  $this->db->addIndex('webr_items', ['webr_id', 'active'], 'i4');
51  }
52  }
53 }
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
General purpose update steps for weblinks.