From 3134f0b93e02472e952949ab0089638b3cda1516 Mon Sep 17 00:00:00 2001 From: hartvig Date: Thu, 10 Jun 2010 09:14:29 +0000 Subject: [PATCH] A little more cleanup in indexes script [TFS Changeset #67708] --- .../SqlHelpers/SqlServer/Sql/KeysIndexesAndConstraints.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/umbraco/datalayer/SqlHelpers/SqlServer/Sql/KeysIndexesAndConstraints.sql b/umbraco/datalayer/SqlHelpers/SqlServer/Sql/KeysIndexesAndConstraints.sql index 881a9ea653..de67f95341 100644 --- a/umbraco/datalayer/SqlHelpers/SqlServer/Sql/KeysIndexesAndConstraints.sql +++ b/umbraco/datalayer/SqlHelpers/SqlServer/Sql/KeysIndexesAndConstraints.sql @@ -22,6 +22,9 @@ delete from cmsContentXml where nodeid not in (select nodeId from cmsContent) delete from cmsDocumentType where contentTypeNodeId not in (select nodeId from cmsContentType) delete from cmsDocumentType where templateNodeId not in (select nodeid from cmsTemplate) +/* UPDATE EMPTY TEMPLATE REFERENCES IN DOCUMENTS */ +update cmsDocument set templateId = NULL where templateId not in (select nodeId from cmsTemplate) + /************************** CLEANUP END ********************************************/