From 153fe248a70cfab6925872361b2e16f1d8f8df75 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Thu, 25 Apr 2013 19:33:53 -1000 Subject: [PATCH] Fixes ContentService fix for issue U4-1772, we don't want to truncate! Plus the truncate term doesn't work in SQLCE anyways. --- src/Umbraco.Core/Services/ContentService.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 1254bb295c..d6716ba357 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1096,9 +1096,11 @@ namespace Umbraco.Core.Services { if (!contentTypeIds.Any()) { - //since we're updating all records, it will be much faster to just clear the table first - uow.Database.TruncateTable("cmsContentXml"); - + //Remove all Document records from the cmsContentXml table (DO NOT REMOVE Media/Members!) + uow.Database.Execute(@"DELETE FROM cmsContentXml WHERE nodeId IN + (SELECT DISTINCT cmsContentXml.nodeId FROM cmsContentXml + INNER JOIN cmsDocument ON cmsContentXml.nodeId = cmsDocument.nodeId)"); + //get all content items that are published // Consider creating a Path query instead of recursive method: // var query = Query.Builder.Where(x => x.Path.StartsWith("-1"));