Renames ContentAndMediaTypeBaseController, adds migration to add new db column for list view config

This commit is contained in:
Shannon
2014-09-10 15:47:01 +10:00
parent 7422238087
commit e3bf5d3487
5 changed files with 49 additions and 5 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.Data;
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
{
[Migration("7.2.0", 1, GlobalSettings.UmbracoMigrationName)]
public class AlterContentTypeTable : MigrationBase
{
public override void Up()
{
if (Context == null || Context.Database == null) return;
Upgrade();
}
private void Initial()
{
//new container config col
Alter.Table("cmsContentType").AddColumn("containerConfig").AsString().Nullable();
}
public override void Down()
{
Delete.Column("containerConfig").FromTable("cmsContentType");
}
/// <summary>
/// A custom class to map to so that we can linq to it easily without dynamics
/// </summary>
private class PropertyTypeReferenceDto
{
public int NodeId { get; set; }
public int PropertyTypeId { get; set; }
}
}
}

View File

@@ -390,6 +390,7 @@
<Compile Include="Persistence\Mappers\TemplateMapper.cs" />
<Compile Include="Persistence\Migrations\DataLossException.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenOneZero\AssignMissingPrimaryForMySqlKeys.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwoZero\AlterTagRelationsTable.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSixTwoZero\AssignMissingPrimaryForMySqlKeys.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSixTwoZero\AssignMissingPrimaryForMySqlKeys2.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSixTwoZero\ChangePasswordColumn.cs" />

View File

@@ -25,7 +25,7 @@ namespace Umbraco.Web.Editors
/// An API controller used for dealing with content types
/// </summary>
[PluginController("UmbracoApi")]
public class ContentTypeController : ContentAndMediaTypeBaseController
public class ContentTypeController : ContentTypeControllerBase
{
private ICultureDictionary _cultureDictionary;

View File

@@ -15,12 +15,12 @@ namespace Umbraco.Web.Editors
/// Am abstract API controller providing functionality used for dealing with content and media types
/// </summary>
[PluginController("UmbracoApi")]
public abstract class ContentAndMediaTypeBaseController : UmbracoAuthorizedJsonController
public abstract class ContentTypeControllerBase : UmbracoAuthorizedJsonController
{
/// <summary>
/// Constructor
/// </summary>
public ContentAndMediaTypeBaseController()
public ContentTypeControllerBase()
: this(UmbracoContext.Current)
{
}
@@ -29,7 +29,7 @@ namespace Umbraco.Web.Editors
/// Constructor
/// </summary>
/// <param name="umbracoContext"></param>
public ContentAndMediaTypeBaseController(UmbracoContext umbracoContext)
public ContentTypeControllerBase(UmbracoContext umbracoContext)
: base(umbracoContext)
{
}

View File

@@ -21,7 +21,7 @@ namespace Umbraco.Web.Editors
/// An API controller used for dealing with media types
/// </summary>
[PluginController("UmbracoApi")]
public class MediaTypeController : ContentAndMediaTypeBaseController
public class MediaTypeController : ContentTypeControllerBase
{
/// <summary>
/// Constructor