Skip to content

Commit

Permalink
Added some missing indexes to database
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisbogdan committed Jan 24, 2024
1 parent 4beb5b3 commit 8eb9c80
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/NzbDrone.Core/Datastore/Migration/236_add_indexes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;

namespace NzbDrone.Core.Datastore.Migration
{
[Migration(236)]
public class add_indexes : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Create.Index().OnTable("Blocklist").OnColumn("MovieId");
Create.Index().OnTable("Blocklist").OnColumn("Date");

Create.Index()
.OnTable("History")
.OnColumn("MovieId").Ascending()
.OnColumn("Date").Descending();

Delete.Index().OnTable("History").OnColumn("DownloadId");
Create.Index()
.OnTable("History")
.OnColumn("DownloadId").Ascending()
.OnColumn("Date").Descending();

Create.Index().OnTable("Movies").OnColumn("MovieFileId");
Create.Index().OnTable("Movies").OnColumn("Path");
}
}
}

0 comments on commit 8eb9c80

Please sign in to comment.