From 8f7147d17ec1c87747c90d3a895be7bfeef22182 Mon Sep 17 00:00:00 2001 From: jbstark Date: Mon, 22 Jul 2024 19:05:42 -0700 Subject: [PATCH] Fixed: Removed json_extract --- .../Datastore/Migration/210_add_monitored_seasons_filter.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Datastore/Migration/210_add_monitored_seasons_filter.cs b/src/NzbDrone.Core/Datastore/Migration/210_add_monitored_seasons_filter.cs index 8532a598e..24d75c7e0 100644 --- a/src/NzbDrone.Core/Datastore/Migration/210_add_monitored_seasons_filter.cs +++ b/src/NzbDrone.Core/Datastore/Migration/210_add_monitored_seasons_filter.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Data; using Dapper; @@ -23,7 +22,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getUnmonitoredSeasonFilter = conn.CreateCommand()) { getUnmonitoredSeasonFilter.Transaction = tran; - getUnmonitoredSeasonFilter.CommandText = "SELECT \"Id\", \"Filters\" FROM \"CustomFilters\" WHERE EXISTS (SELECT 1 FROM json_each(\"Filters\") AS EACH WHERE json_extract(EACH.value, '$.key') = 'hasUnmonitoredSeason')"; + getUnmonitoredSeasonFilter.CommandText = "SELECT \"Id\", \"Filters\" FROM \"CustomFilters\""; using (var reader = getUnmonitoredSeasonFilter.ExecuteReader()) { @@ -34,7 +33,7 @@ namespace NzbDrone.Core.Datastore.Migration foreach (var filter in filters) { - if (filter["key"].ToString() == "hasUnmonitoredSeason") + if (filter["key"]?.ToString() == "hasUnmonitoredSeason") { var value = filter["value"].ToString(); var type = filter["type"].ToString(); @@ -70,7 +69,6 @@ namespace NzbDrone.Core.Datastore.Migration } } - Console.WriteLine("Migrating 210"); var updateSql = "UPDATE \"CustomFilters\" SET \"Filters\" = @Filters WHERE \"Id\" = @Id"; conn.Execute(updateSql, updated, transaction: tran); }