Forked from kipusoep/umbraco-clear-recycle-bin.sql
Last active
September 21, 2018 20:55
-
-
Save nick-hoang/8c2d4146b8dae2b89cc855480b563c0c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Delete old nodes (keep recent 15 days) from Trash, Umbraco 7.7.6 | |
--deletes in Document | |
--at this point all associated media files are deleted | |
delete from umbracoDomains where id in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsDocument where nodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
--deletes in Content | |
delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsPreviewXml where nodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsContentVersion where ContentId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsContentXml where NodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
--deletes in CMSNode | |
delete from umbracoRelation where parentId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from umbracoRelation where childId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsTask where nodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from umbracoUser2NodeNotify where nodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsTagRelationship where nodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsContent where nodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment