|
|
@@ -144,7 +144,7 @@ class CleanDb extends BaseCronJob implements CronjobInterface
|
|
|
$sql = "DELETE r
|
|
|
FROM opentalent.Message m
|
|
|
inner join opentalent.ReportMessage r on r.message_id = m.id
|
|
|
- where m.dateSent < :maxDate and m.isSystem = true and m.id > 0;";
|
|
|
+ where (m.dateSent < :maxDate or (m.dateSent is null and m.createDate < :maxDate)) and m.isSystem = true and m.id > 0;";
|
|
|
|
|
|
$stmt = $this->connection->prepare($sql);
|
|
|
$purgedReportMessage = $stmt->executeStatement(['maxDate' => $maxDate->format('c')]);
|
|
|
@@ -153,7 +153,7 @@ class CleanDb extends BaseCronJob implements CronjobInterface
|
|
|
|
|
|
$sql = "DELETE
|
|
|
FROM opentalent.Message
|
|
|
- where dateSent < :maxDate and isSystem = true and id > 0;";
|
|
|
+ where (m.dateSent < :maxDate or (m.dateSent is null and m.createDate < :maxDate)) and isSystem = true and id > 0;";
|
|
|
|
|
|
$stmt = $this->connection->prepare($sql);
|
|
|
$purgedMessage = $stmt->executeStatement(['maxDate' => $maxDate->format('c')]);
|