mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-22 02:36:09 +01:00
Delete only six weeks old dates in cleanup past service
This commit is contained in:
parent
7db61a189a
commit
087e49df4a
1 changed files with 2 additions and 2 deletions
|
@ -69,10 +69,10 @@ final class Database
|
|||
|
||||
$queryBuilder->getRestrictions()->removeAll();
|
||||
|
||||
$midnightToday = new DateTimeImmutable('midnight today');
|
||||
$sixWeeksAgo = (new DateTimeImmutable())->modify('-6 weeks')->setTime(0, 0, 0);
|
||||
$queryBuilder->delete(self::DATE_TABLE)->where($queryBuilder->expr()->lte(
|
||||
'end',
|
||||
$queryBuilder->createNamedParameter($midnightToday->format('U'))
|
||||
$queryBuilder->createNamedParameter($sixWeeksAgo->format('U'))
|
||||
))->executeStatement();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue