Skip to content
Merged
Changes from 2 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
8 changes: 8 additions & 0 deletions lib/private/Repair/RemoveBrokenProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace OC\Repair;

use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IAppConfig;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
Expand All @@ -18,6 +19,7 @@
class RemoveBrokenProperties implements IRepairStep {
public function __construct(
private readonly IDBConnection $db,
private readonly IAppConfig $appConfig,
) {
}

Expand All @@ -28,6 +30,10 @@ public function getName(): string {

#[Override]
public function run(IOutput $output): void {
if ($this->appConfig->getValueBool('core', 'repair_removed_broken_properties', lazy: true)) {
Comment thread
kyteinsky marked this conversation as resolved.
Outdated
return;
}

// retrieve all object properties
$qb = $this->db->getQueryBuilder();
$qb->select('id', 'propertyvalue')
Expand Down Expand Up @@ -56,6 +62,8 @@ public function run(IOutput $output): void {
$qb->executeStatement();
}
$total = count($brokenIds);

$this->appConfig->setValueBool('core', 'repair_removed_broken_properties', true, lazy: true);
$output->info("$total broken object properties removed");
}
}
Loading