ILIAS  release_8 Revision v8.25
class.ilExerciseDBUpdateSteps.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21namespace ILIAS\Exercise\Setup;
22
27{
28 protected \ilDBInterface $db;
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->indexExistsByFields('exc_assignment', ['exc_id'])) {
38 $this->db->addIndex('exc_assignment', ['exc_id'], 'i1');
39 }
40 }
41
42 public function step_2(): void
43 {
44 if (!$this->db->indexExistsByFields('exc_members', ['usr_id'])) {
45 $this->db->addIndex('exc_members', ['usr_id'], 'i1');
46 }
47 }
48
49 public function step_3(): void
50 {
51 if (!$this->db->indexExistsByFields('exc_assignment', ['deadline_mode', 'exc_id'])) {
52 $this->db->addIndex('exc_assignment', ['deadline_mode', 'exc_id'], 'i2');
53 }
54 }
55
56 public function step_4(): void
57 {
58 if (!$this->db->indexExistsByFields('exc_ass_file_order', ['assignment_id'])) {
59 $this->db->addIndex('exc_ass_file_order', ['assignment_id'], 'i1');
60 }
61 }
62
63 public function step_5(): void
64 {
65 if (!$this->db->indexExistsByFields('il_exc_team', ['id'])) {
66 $this->db->addIndex('il_exc_team', ['id'], 'i1');
67 }
68 }
69}
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: class.Agent.php:21