Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,27 @@

use ILIAS\Setup;
use ILIAS\Setup\Config;
use ILIAS\Setup\ObjectiveCollection;

class ilTrackingSetupAgent extends Setup\Agent\NullAgent
{
public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
public function getUpdateObjective(Config $config = null): Setup\Objective
{
return new ilDatabaseUpdateStepsExecutedObjective(new ilTrackingUpdateSteps9());
return new ObjectiveCollection(
'Database is updated for component/ILIAS/Tracking',
true,
new ilDatabaseUpdateStepsExecutedObjective(new ilTrackingUpdateSteps9()),
new ilDatabaseUpdateStepsExecutedObjective(new ilTrackingUpdateSteps10())
);
}

public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
{
return new ilDatabaseUpdateStepsMetricsCollectedObjective($storage, new ilTrackingUpdateSteps9());
return new ObjectiveCollection(
'Database update status for component/ILIAS/Tracking',
true,
new ilDatabaseUpdateStepsMetricsCollectedObjective($storage, new ilTrackingUpdateSteps9()),
new ilDatabaseUpdateStepsMetricsCollectedObjective($storage, new ilTrackingUpdateSteps10())
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* 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
*
*********************************************************************/

declare(strict_types=1);

class ilTrackingUpdateSteps10 implements ilDatabaseUpdateSteps
{
protected ilDBInterface $db;

public function prepare(ilDBInterface $db): void
{
$this->db = $db;
}

public function step_1(): void
{
if (!$this->db->indexExistsByFields('ut_lp_marks', ['usr_id'])) {
$this->db->addIndex('ut_lp_marks', ['usr_id'], 'i1');
}
}
}