From 451c358879e1f6f2fda26e4b85ef97982fbeaba5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 25 Jul 2016 16:49:08 +1200 Subject: Improve history clearing logic --- debug.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debug.xml') diff --git a/debug.xml b/debug.xml index 346eda292..304ae7f3d 100644 --- a/debug.xml +++ b/debug.xml @@ -323,8 +323,8 @@ DELETE FROM notifications WHERE id = :id; - - DELETE FROM positions WHERE id != :positionId and deviceid = :deviceId and servertime < :serverTime; + + DELETE FROM positions WHERE serverTime < :serverTime AND id NOT IN (SELECT positionId FROM devices); -- cgit v1.2.3