Skip to content

Commit

Permalink
tweak to hard delete structures not linked to revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
i-just committed Sep 10, 2024
1 parent 74f6a2d commit 2accf9c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/Gc.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ private function _hardDeleteStructures(): void
->leftJoin(['r' => $revisionsTable], '[[r.canonicalId]] = coalesce([[e.canonicalId]],[[e.id]])')
->where([
'and',
['not', ['se.elementId' => null]],
$this->_hardDeleteCondition('s'),
[
'r.canonicalId' => null,
Expand All @@ -624,7 +625,7 @@ private function _hardDeleteStructures(): void
if ($this->db->getIsMysql()) {
$sql = <<<SQL
DELETE [[s]].* FROM $structuresTable [[s]]
WHERE [[s.id]] NOT IN ($ids)
WHERE [[s.id]] IN ($ids)
AND $conditionSql
SQL;
} else {
Expand All @@ -633,7 +634,7 @@ private function _hardDeleteStructures(): void
USING $structuresTable [[s]]
WHERE
$structuresTable.[[id]] = [[s.id]] AND
[[s.id]] NOT IN ($ids) AND
[[s.id]] IN ($ids) AND
$conditionSql
SQL;
}
Expand Down

0 comments on commit 2accf9c

Please sign in to comment.