Skip to content

Instantly share code, notes, and snippets.

@hafriedlander
Created May 26, 2011 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hafriedlander/398ce8b325916eec1080 to your computer and use it in GitHub Desktop.
Save hafriedlander/398ce8b325916eec1080 to your computer and use it in GitHub Desktop.
@@ -546,6 +546,9 @@ class Page_CleanHistory extends BuildTask {
echo "Final cleanup\n";
+ DB::query("DELETE FROM SiteTree WHERE ID NOT IN (SELECT RecordID FROM SiteTree_versions)");
+ DB::query("DELETE FROM SiteTree_Live WHERE ID NOT IN (SELECT RecordID FROM SiteTree_versions)");
+
foreach (ClassInfo::dataClassesFor('SiteTree') as $table) {
if ($table == 'SiteTree') continue;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment