Created
March 25, 2024 20:23
-
-
Save AaronSadlerUK/ab3a51647f3755b8b8f84b7bec25e91e to your computer and use it in GitHub Desktop.
Upgrade to 8.18.13 fix - Source https://github.com/umbraco/Umbraco-CMS/issues/11723#issuecomment-1862710096
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @AlterStatements TABLE ( | |
Statement NVARCHAR(MAX) | |
) | |
INSERT INTO @AlterStatements (Statement) | |
SELECT 'ALTER INDEX [' + I.name + '] ON [' + T.name + '] REBUILD' | |
FROM sys.indexes I | |
INNER JOIN sys.tables T ON I.object_id = T.object_id | |
WHERE I.type_desc = 'NONCLUSTERED' | |
AND I.name IS NOT NULL | |
DECLARE @Statement NVARCHAR(MAX) | |
DECLARE AlterCursor CURSOR FOR | |
SELECT Statement FROM @AlterStatements | |
OPEN AlterCursor | |
FETCH NEXT FROM AlterCursor INTO @Statement | |
WHILE @@FETCH_STATUS = 0 | |
BEGIN | |
EXEC sp_executesql @Statement | |
FETCH NEXT FROM AlterCursor INTO @Statement | |
END | |
CLOSE AlterCursor | |
DEALLOCATE AlterCursor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop table [dbo].[umbracoContentVersionCleanupPolicy] | |
GO | |
--drop table umbracoContentVersionCleanupPolicy | |
CREATE TABLE [dbo].[umbracoContentVersionCleanupPolicy]( | |
[contentTypeId] [int] NOT NULL, | |
[preventCleanup] [bit] NOT NULL, | |
[keepAllVersionsNewerThanDays] [int] NULL, | |
[keepLatestVersionPerDayForDays] [int] NULL, | |
[updated] [datetime] NOT NULL | |
) ON [PRIMARY] | |
GO | |
ALTER TABLE [dbo].[umbracoContentVersionCleanupPolicy] WITH NOCHECK ADD CONSTRAINT [FK_umbracoContentVersionCleanupPolicy_cmsContentType_nodeId] CHECK (([contentTypeId]<>'')) | |
GO | |
ALTER TABLE [dbo].[umbracoContentVersionCleanupPolicy] CHECK CONSTRAINT [FK_umbracoContentVersionCleanupPolicy_cmsContentType_nodeId] | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment