Fix for movies without an imdbid. Fixes 176

This commit is contained in:
Leonardo Galli 2017-01-28 17:54:19 +01:00
parent 5e9a79afe8
commit 3276e3ec52
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
using System.Data;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(125)]
public class fix_imdb_unique : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Execute.WithConnection(DeleteUniqueIndex);
}
private void DeleteUniqueIndex(IDbConnection conn, IDbTransaction tran)
{
using (IDbCommand getSeriesCmd = conn.CreateCommand())
{
getSeriesCmd.Transaction = tran;
getSeriesCmd.CommandText = @"DROP INDEX 'IX_Movies_ImdbId'";
getSeriesCmd.ExecuteNonQuery();
}
}
}
}

View File

@ -183,6 +183,7 @@
<Compile Include="Datastore\Migration\002_remove_tvrage_imdb_unique_constraint.cs" /> <Compile Include="Datastore\Migration\002_remove_tvrage_imdb_unique_constraint.cs" />
<Compile Include="Datastore\Migration\003_remove_clean_title_from_scene_mapping.cs" /> <Compile Include="Datastore\Migration\003_remove_clean_title_from_scene_mapping.cs" />
<Compile Include="Datastore\Migration\004_updated_history.cs" /> <Compile Include="Datastore\Migration\004_updated_history.cs" />
<Compile Include="Datastore\Migration\125_fix_imdb_unique.cs" />
<Compile Include="Datastore\Migration\124_add_preferred_tags_to_profile.cs" /> <Compile Include="Datastore\Migration\124_add_preferred_tags_to_profile.cs" />
<Compile Include="Datastore\Migration\122_add_movieid_to_blacklist.cs" /> <Compile Include="Datastore\Migration\122_add_movieid_to_blacklist.cs" />
<Compile Include="Datastore\Migration\121_update_filedate_config.cs" /> <Compile Include="Datastore\Migration\121_update_filedate_config.cs" />