diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2023-01-19 10:09:32 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2023-01-19 10:09:32 +0100 |
| commit | 656a0bff6fd48ba66cfe8fc7b470380c38afbac2 (patch) | |
| tree | a89f0545050bf6672936c6e7ea3e2b0e5c5561f2 /Jellyfin.Server/Migrations/Routines/AddPeopleQueryIndex.cs | |
| parent | ef085483b2ef54195e16f282330a3c204e3227b6 (diff) | |
| parent | d57dcf22452db4990aa2cdece3eb798ba98b8330 (diff) | |
Merge remote-tracking branch 'upstream/master' into network-rewrite
Diffstat (limited to 'Jellyfin.Server/Migrations/Routines/AddPeopleQueryIndex.cs')
| -rw-r--r-- | Jellyfin.Server/Migrations/Routines/AddPeopleQueryIndex.cs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/AddPeopleQueryIndex.cs b/Jellyfin.Server/Migrations/Routines/AddPeopleQueryIndex.cs deleted file mode 100644 index 6343c422d..000000000 --- a/Jellyfin.Server/Migrations/Routines/AddPeopleQueryIndex.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.IO; -using MediaBrowser.Controller; -using Microsoft.Extensions.Logging; -using SQLitePCL.pretty; - -namespace Jellyfin.Server.Migrations.Routines -{ - /// <summary> - /// Migration to add table indexes to optimize the Persons query. - /// </summary> - public class AddPeopleQueryIndex : IMigrationRoutine - { - private const string DbFilename = "library.db"; - private readonly ILogger<AddPeopleQueryIndex> _logger; - private readonly IServerApplicationPaths _serverApplicationPaths; - - /// <summary> - /// Initializes a new instance of the <see cref="AddPeopleQueryIndex"/> class. - /// </summary> - /// <param name="logger">Instance of the <see cref="ILogger{AddPeopleQueryIndex}"/> interface.</param> - /// <param name="serverApplicationPaths">Instance of the <see cref="IServerApplicationPaths"/> interface.</param> - public AddPeopleQueryIndex(ILogger<AddPeopleQueryIndex> logger, IServerApplicationPaths serverApplicationPaths) - { - _logger = logger; - _serverApplicationPaths = serverApplicationPaths; - } - - /// <inheritdoc /> - public Guid Id => new Guid("DE009B59-BAAE-428D-A810-F67762DC05B8"); - - /// <inheritdoc /> - public string Name => "AddPeopleQueryIndex"; - - /// <inheritdoc /> - public bool PerformOnNewInstall => true; - - /// <inheritdoc /> - public void Perform() - { - var databasePath = Path.Join(_serverApplicationPaths.DataPath, DbFilename); - using var connection = SQLite3.Open(databasePath, ConnectionFlags.ReadWrite, null); - _logger.LogInformation("Creating index idx_TypedBaseItemsUserDataKeyType"); - connection.Execute("CREATE INDEX IF NOT EXISTS idx_TypedBaseItemsUserDataKeyType ON TypedBaseItems(UserDataKey, Type);"); - _logger.LogInformation("Creating index idx_PeopleNameListOrder"); - connection.Execute("CREATE INDEX IF NOT EXISTS idx_PeopleNameListOrder ON People(Name, ListOrder);"); - } - } -} |
