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
Branches
Tags
No related merge requests found
...@@ -154,7 +154,8 @@ class Draft { ...@@ -154,7 +154,8 @@ class Draft {
// Keep client drafts for two weeks (14 days) // Keep client drafts for two weeks (14 days)
$sql = 'DELETE FROM '.DRAFT_TABLE $sql = 'DELETE FROM '.DRAFT_TABLE
." WHERE `namespace` LIKE 'ticket.client.%' ." 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); return db_query($sql);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment