Skip to content
Snippets Groups Projects
Commit 490f39cd authored by Jared Hancock's avatar Jared Hancock
Browse files

draft: Clean old, never-updated drafts

parent 9ce63f38
No related branches found
No related tags found
No related merge requests found
......@@ -154,7 +154,8 @@ class Draft {
// Keep client drafts for two weeks (14 days)
$sql = 'DELETE FROM '.DRAFT_TABLE
." WHERE `namespace` LIKE 'ticket.client.%'
AND datediff(now(), updated) > 14";
AND ((updated IS NULL AND datediff(now(), created) > 14)
OR datediff(now(), updated) > 14)";
return db_query($sql);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment