mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-02 18:55:38 -04:00
Migration will clean unmapped history items
This commit is contained in:
25
NzbDrone.Core/Datastore/Migrations/Migration20120727.cs
Normal file
25
NzbDrone.Core/Datastore/Migrations/Migration20120727.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using Migrator.Framework;
|
||||
using NzbDrone.Common;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migrations
|
||||
{
|
||||
|
||||
[Migration(20120727)]
|
||||
public class Migration20120727 : NzbDroneMigration
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Database.ExecuteNonQuery(@"DELETE FROM History
|
||||
WHERE HistoryId IN
|
||||
(
|
||||
SELECT History.HistoryId
|
||||
FROM History
|
||||
LEFT OUTER JOIN Episodes
|
||||
ON History.EpisodeId = Episodes.EpisodeId
|
||||
WHERE Episodes.Title is null
|
||||
)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,6 +227,7 @@
|
||||
<Compile Include="Datastore\MigrationLogger.cs" />
|
||||
<Compile Include="Datastore\MigrationsHelper.cs" />
|
||||
<Compile Include="Datastore\CustomeMapper.cs" />
|
||||
<Compile Include="Datastore\Migrations\Migration20120727.cs" />
|
||||
<Compile Include="Datastore\Migrations\Migration20120504.cs" />
|
||||
<Compile Include="Datastore\Migrations\Migration20120430.cs" />
|
||||
<Compile Include="Datastore\Migrations\Migration20120420.cs" />
|
||||
|
||||
Reference in New Issue
Block a user