Skip to content

Commit 991ebca

Browse files
committed
skip duplication tidy, if one of the columns does not exist
Signed-off-by: dartcafe <github@dartcafe.de>
1 parent eb5321a commit 991ebca

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/Db/V6/TableManager.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@ private function deleteDuplicates(string $table, array $columns):int {
416416
$i = 0;
417417

418418
foreach ($columns as $column) {
419+
if (!$this->schema->getTable($this->dbPrefix . $table)->hasColumn($column)) {
420+
$this->logger->warning('Column {column} does not exist in table {table} - cannot check for duplicates based on this column', ['column' => $column, 'table' => $this->dbPrefix . $table]);
421+
return 0;
422+
}
423+
419424
if ($i > 0) {
420425
$selection->andWhere($qb->expr()->eq('t1.' . $column, 't2.' . $column));
421426
} else {

0 commit comments

Comments
 (0)