Skip to content

Instantly share code, notes, and snippets.

@kipusoep
Created December 20, 2016 12:25
Show Gist options
  • Select an option

  • Save kipusoep/bf5bde5ed85a896afda25df6b465ce76 to your computer and use it in GitHub Desktop.

Select an option

Save kipusoep/bf5bde5ed85a896afda25df6b465ce76 to your computer and use it in GitHub Desktop.

Revisions

  1. kipusoep created this gist Dec 20, 2016.
    20 changes: 20 additions & 0 deletions umbraco-clear-recycle-bin.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    --deletes in Document
    --at this point all associated media files are deleted
    delete from umbracoDomains where id in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from cmsDocument where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);

    --deletes in Content
    delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from cmsPreviewXml where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from cmsContentVersion where ContentId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from cmsContentXml where NodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);

    --deletes in CMSNode
    delete from umbracoRelation where parentId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from umbracoRelation where childId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from cmsTask where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from umbracoUser2NodeNotify where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from cmsTagRelationship where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from umbracoUser2NodePermission where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from cmsContent where nodeId in (select id from umbracoNode where path like '%-20%' and id!=-20);
    delete from umbracoNode where path like '%-20%' and id!=-20;