Add cmsPreviewXml table if it doesn't yet exist
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourOneZero
|
||||
{
|
||||
[Migration("4.1.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
public class AddPreviewXmlTable : MigrationBase
|
||||
{
|
||||
public AddPreviewXmlTable(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
: base(sqlSyntax, logger)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Up()
|
||||
{
|
||||
var tableName = "cmsPreviewXml";
|
||||
var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray();
|
||||
if (tables.InvariantContains(tableName)) return;
|
||||
|
||||
Create.Table(tableName)
|
||||
.WithColumn("nodeId").AsInt32().NotNullable()
|
||||
.WithColumn("versionId").AsGuid().NotNullable()
|
||||
.WithColumn("timestamp").AsDateTime().NotNullable()
|
||||
.WithColumn("xml").AsString();
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -415,6 +415,7 @@
|
||||
<Compile Include="Persistence\Mappers\AccessMapper.cs" />
|
||||
<Compile Include="Persistence\Mappers\DomainMapper.cs" />
|
||||
<Compile Include="Persistence\Mappers\MigrationEntryMapper.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionFourOneZero\AddPreviewXmlTable.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFiveZero\EnsureServersLockObject.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFourZero\FixListViewMediaSortOrder.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFourZero\AddDataDecimalColumn.cs" />
|
||||
|
||||
Reference in New Issue
Block a user