From f332e9a07e13b9a27cb4516cc5efefadb1909a74 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 24 Oct 2018 15:45:24 +1100 Subject: [PATCH] Fix sql and table check --- .../Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs | 7 +++++-- .../Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs index c9eba205e8..2f50b9cd72 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs @@ -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(Sql().Select().Where(x => x.EditorAlias.Contains(".DropDown"))); + var oldDropDowns = Database.Fetch(Sql() + .Select() + .From() + .Where(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() + var propDataSql = Sql().Select().From() .InnerJoin().On(x => x.Id, x => x.PropertyTypeId) .InnerJoin().On(x => x.NodeId, x => x.DataTypeId) .Where(x => x.EditorAlias == dd.EditorAlias); diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs index 26402cc477..fa6e47fac7 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs @@ -9,7 +9,8 @@ public override void Migrate() { // drop preValues table - Delete.Table("cmsDataTypePreValues").Do(); + if (TableExists("cmsDataTypePreValues")) + Delete.Table("cmsDataTypePreValues").Do(); } } }