-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcleaner2.sql
19 lines (19 loc) · 1.66 KB
/
cleaner2.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
SET @date_threshold = 86400 * 90;
DELETE FROM swtickets WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketpostlocks WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketlocks WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketlinkchains WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketfollowups WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketdrafts WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swescalationpaths WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketnotes WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketauditlogs WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketlinkedtables WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketlinks WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketmergelog WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketmessageids WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketposts WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swticketwatchers WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swtickettimetracks WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swattachments WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));
DELETE FROM swcustomfieldvalues WHERE (dateline + @date_threshold < UNIX_TIMESTAMP(NOW()));