diff --git a/src/NzbDrone.Core.Test/Datastore/Migration/207_movie_metadataFixture.cs b/src/NzbDrone.Core.Test/Datastore/Migration/207_movie_metadataFixture.cs index d50704407..d36022b01 100644 --- a/src/NzbDrone.Core.Test/Datastore/Migration/207_movie_metadataFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/Migration/207_movie_metadataFixture.cs @@ -294,6 +294,7 @@ namespace NzbDrone.Core.Test.Datastore.Migration c.Insert.IntoTable("ImportListMovies").Row(new { Title = "Title", + Overview = "Overview 1", Status = 3, Images = new[] { new { CoverType = "Poster" } }.ToJson(), Runtime = 90, @@ -306,6 +307,7 @@ namespace NzbDrone.Core.Test.Datastore.Migration c.Insert.IntoTable("ImportListMovies").Row(new { Title = "Title", + Overview = "Overview 2", Status = 3, Images = new[] { new { CoverType = "Poster" } }.ToJson(), Runtime = 90, diff --git a/src/NzbDrone.Core/Datastore/Migration/207_movie_metadata.cs b/src/NzbDrone.Core/Datastore/Migration/207_movie_metadata.cs index fd79ae5e8..0bbb7f558 100644 --- a/src/NzbDrone.Core/Datastore/Migration/207_movie_metadata.cs +++ b/src/NzbDrone.Core/Datastore/Migration/207_movie_metadata.cs @@ -44,9 +44,10 @@ namespace NzbDrone.Core.Datastore.Migration // Transfer metadata from ImportListMovies to MovieMetadata if not already in Execute.Sql(@"INSERT INTO ""MovieMetadata"" (""TmdbId"", ""ImdbId"", ""Title"", ""SortTitle"", ""CleanTitle"", ""OriginalTitle"", ""CleanOriginalTitle"", ""OriginalLanguage"", ""Overview"", ""Status"", ""LastInfoSync"", ""Images"", ""Genres"", ""Ratings"", ""Runtime"", ""InCinemas"", ""PhysicalRelease"", ""DigitalRelease"", ""Year"", ""Recommendations"", ""Certification"", ""YouTubeTrailerId"", ""Studio"", ""Collection"", ""Website"") - SELECT DISTINCT ""TmdbId"", ""ImdbId"", ""Title"", ""SortTitle"", ""Title"", ""OriginalTitle"", ""OriginalTitle"", 1, ""Overview"", ""Status"", ""LastInfoSync"", ""Images"", ""Genres"", ""Ratings"", ""Runtime"", ""InCinemas"", ""PhysicalRelease"", ""DigitalRelease"", ""Year"", '[]', ""Certification"", ""YouTubeTrailerId"", ""Studio"", ""Collection"", ""Website"" + SELECT ""TmdbId"", ""ImdbId"", ""Title"", ""SortTitle"", ""Title"", ""OriginalTitle"", ""OriginalTitle"", 1, ""Overview"", ""Status"", ""LastInfoSync"", ""Images"", ""Genres"", ""Ratings"", ""Runtime"", ""InCinemas"", ""PhysicalRelease"", ""DigitalRelease"", ""Year"", '[]', ""Certification"", ""YouTubeTrailerId"", ""Studio"", ""Collection"", ""Website"" FROM ""ImportListMovies"" - WHERE ""ImportListMovies"".""TmdbId"" NOT IN ( SELECT ""MovieMetadata"".""TmdbId"" FROM ""MovieMetadata"" )"); + WHERE ""ImportListMovies"".""TmdbId"" NOT IN ( SELECT ""MovieMetadata"".""TmdbId"" FROM ""MovieMetadata"" ) + AND ""ImportListMovies"".""Id"" IN ( SELECT MIN(""Id"") FROM ""ImportListMovies"" GROUP BY ""TmdbId"" )"); // Add an MovieMetadataId column to Movies Alter.Table("Movies").AddColumn("MovieMetadataId").AsInt32().WithDefaultValue(0);