ensures media xml cache is rebuilt on upgrade
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero
|
||||
{
|
||||
/// <summary>
|
||||
/// Due to this bug: http://issues.umbraco.org/issue/U4-3820 we need to remove the cached media
|
||||
/// xml found in the cmsContentXml table for any media that has been recycled.
|
||||
/// </summary>
|
||||
[Migration("6.2.0", 1, GlobalSettings.UmbracoMigrationName)]
|
||||
public class RemoveCachedRecycleMediaXml : MigrationBase
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
//now that the controlId column is renamed and now a string we need to convert
|
||||
if (Context == null || Context.Database == null) return;
|
||||
|
||||
Execute.Code(database =>
|
||||
{
|
||||
var mediasvc = (MediaService)ApplicationContext.Current.Services.MediaService;
|
||||
mediasvc.RebuildXmlStructures();
|
||||
|
||||
return string.Empty;
|
||||
});
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,6 +189,7 @@
|
||||
<Compile Include="Models\PublishedContent\IPublishedContentModelFactory.cs" />
|
||||
<Compile Include="Models\PublishedContent\PublishedContentModel.cs" />
|
||||
<Compile Include="Models\PublishedContent\PublishedContentModelFactoryResolver.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSixTwoZero\RemoveCachedRecycleMediaXml.cs" />
|
||||
<Compile Include="PropertyEditors\PropertyCacheValue.cs" />
|
||||
<Compile Include="PropertyEditors\PropertyValueCacheAttribute.cs" />
|
||||
<Compile Include="PropertyEditors\PropertyValueTypeAttribute.cs" />
|
||||
|
||||
Reference in New Issue
Block a user