From c4324c8e47b57c631abb96c86ee9719cef8417e9 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 30 Nov 2020 13:53:08 -0500 Subject: [PATCH] Fixed: Migrate fails for Sonarr contaminated DBs --- .../Migration/153_indexer_client_status_search_changes.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/NzbDrone.Core/Datastore/Migration/153_indexer_client_status_search_changes.cs b/src/NzbDrone.Core/Datastore/Migration/153_indexer_client_status_search_changes.cs index 9a9a6dadc..74cb33345 100644 --- a/src/NzbDrone.Core/Datastore/Migration/153_indexer_client_status_search_changes.cs +++ b/src/NzbDrone.Core/Datastore/Migration/153_indexer_client_status_search_changes.cs @@ -8,6 +8,12 @@ namespace NzbDrone.Core.Datastore.Migration { protected override void MainDbUpgrade() { + //Cleanup cases of Sonarr Interference with Radarr db + if (Schema.Table("PendingReleases").Column("Reason").Exists()) + { + Delete.Column("Reason").FromTable("PendingReleases"); + } + Alter.Table("PendingReleases").AddColumn("Reason").AsInt32().WithDefaultValue(0); Rename.Column("IndexerId").OnTable("IndexerStatus").To("ProviderId");