Skip to content

Instantly share code, notes, and snippets.

View nick-hoang's full-sized avatar

Nick Hoàng nick-hoang

  • Code Brewery
  • Hanoi, Vietnam
View GitHub Profile
--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()));