From ddf83230f33cb51d040428a7e0f3df81089ce4c2 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 12 Oct 2013 21:24:56 -0700 Subject: [PATCH] Fixed omgwtfnzbs issues with null settings Fixed: omgwtfnzbs settings issue --- .../Datastore/Migration/027_fix_omgwtfnzbs.cs | 24 +++++++++++++++++++ src/NzbDrone.Core/NzbDrone.Core.csproj | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 src/NzbDrone.Core/Datastore/Migration/027_fix_omgwtfnzbs.cs diff --git a/src/NzbDrone.Core/Datastore/Migration/027_fix_omgwtfnzbs.cs b/src/NzbDrone.Core/Datastore/Migration/027_fix_omgwtfnzbs.cs new file mode 100644 index 000000000..d7b8b31fc --- /dev/null +++ b/src/NzbDrone.Core/Datastore/Migration/027_fix_omgwtfnzbs.cs @@ -0,0 +1,24 @@ +using FluentMigrator; +using NzbDrone.Core.Datastore.Migration.Framework; + +namespace NzbDrone.Core.Datastore.Migration +{ + [Migration(27)] + public class fix_omgwtfnzbs : NzbDroneMigrationBase + { + protected override void MainDbUpgrade() + { + Update.Table("Indexers") + .Set(new {ConfigContract = "OmgwtfnzbsSettings"}) + .Where(new {Implementation = "Omgwtfnzbs"}); + + Update.Table("Indexers") + .Set(new {Settings = "{}"}) + .Where(new {Implementation = "Omgwtfnzbs", Settings = (string) null}); + + Update.Table("Indexers") + .Set(new { Settings = "{}" }) + .Where(new { Implementation = "Omgwtfnzbs", Settings = "" }); + } + } +} diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index aefe434dc..8fcb4cc1d 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -178,6 +178,9 @@ + + Code +