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 16, 2024
1 parent 374d206 commit ee9ac95
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/NzbDrone.Core/Datastore/Migration/235_add_indexes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;

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

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 ee9ac95

Please sign in to comment.