Fix sql and table check

This commit is contained in:
Shannon
2018-10-24 15:45:24 +11:00
parent 74c373de84
commit f332e9a07e
2 changed files with 7 additions and 3 deletions

View File

@@ -18,7 +18,10 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
public override void Migrate()
{
//need to convert the old drop down data types to use the new one
var oldDropDowns = Database.Fetch<DataTypeDto>(Sql().Select<DataTypeDto>().Where<DataTypeDto>(x => x.EditorAlias.Contains(".DropDown")));
var oldDropDowns = Database.Fetch<DataTypeDto>(Sql()
.Select<DataTypeDto>()
.From<DataTypeDto>()
.Where<DataTypeDto>(x => x.EditorAlias.Contains(".DropDown")));
foreach(var dd in oldDropDowns)
{
//nothing to change if there is no config
@@ -37,7 +40,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
continue;
}
var propDataSql = Sql().Select("*").From<PropertyDataDto>()
var propDataSql = Sql().Select<PropertyDataDto>().From<PropertyDataDto>()
.InnerJoin<PropertyTypeDto>().On<PropertyTypeDto, PropertyDataDto>(x => x.Id, x => x.PropertyTypeId)
.InnerJoin<DataTypeDto>().On<DataTypeDto, PropertyTypeDto>(x => x.NodeId, x => x.DataTypeId)
.Where<DataTypeDto>(x => x.EditorAlias == dd.EditorAlias);

View File

@@ -9,7 +9,8 @@
public override void Migrate()
{
// drop preValues table
Delete.Table("cmsDataTypePreValues").Do();
if (TableExists("cmsDataTypePreValues"))
Delete.Table("cmsDataTypePreValues").Do();
}
}
}