Moved the SQL insert (to create the new relation type) to a separate DB migration for v7.3.0.
(This may need to be reviewed by Core team?)
This commit is contained in:
@@ -269,7 +269,6 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
private void CreateUmbracoRelationTypeData()
|
||||
{
|
||||
_database.Insert("umbracoRelationType", "id", false, new RelationTypeDto { Id = 1, Alias = Constants.Conventions.Relations.RelateDocumentOnCopy, ChildObjectType = new Guid(Constants.ObjectTypes.Document), ParentObjectType = new Guid(Constants.ObjectTypes.Document), Dual = true, Name = "Relate Document On Copy" });
|
||||
_database.Insert("umbracoRelationType", "id", false, new RelationTypeDto { Id = 2, Alias = Constants.Conventions.Relations.RelateParentDocumentOnDelete, ChildObjectType = new Guid(Constants.ObjectTypes.Document), ParentObjectType = new Guid(Constants.ObjectTypes.Document), Dual = false, Name = "Relate Parent Document On Delete" });
|
||||
}
|
||||
|
||||
private void CreateCmsTaskTypeData()
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZero
|
||||
{
|
||||
[Migration("7.3.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
public class AddRelationTypeForDocumentOnDelete : MigrationBase
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
Execute.Code(AddRelationType);
|
||||
}
|
||||
|
||||
public static string AddRelationType(Database database)
|
||||
{
|
||||
database.Insert("umbracoRelationType", "id", false, new RelationTypeDto { Id = 2, Alias = Constants.Conventions.Relations.RelateParentDocumentOnDelete, ChildObjectType = new Guid(Constants.ObjectTypes.Document), ParentObjectType = new Guid(Constants.ObjectTypes.Document), Dual = false, Name = "Relate Parent Document On Delete" });
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -390,6 +390,7 @@
|
||||
<Compile Include="Persistence\Mappers\TagMapper.cs" />
|
||||
<Compile Include="Persistence\Mappers\TemplateMapper.cs" />
|
||||
<Compile Include="Persistence\Migrations\DataLossException.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenThreeZero\AddRelationTypeForDocumentOnDelete.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwoZero\AddMissingForeignKeyForContentType.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwoZero\AlterDataTypePreValueTable.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenOneZero\AssignMissingPrimaryForMySqlKeys.cs" />
|
||||
|
||||
Reference in New Issue
Block a user