소스 검색

Merge pull request #5863 from cvium/fix-index-migration

use IF NOT EXISTS in migration
Bond-009 4 년 전
부모
커밋
5a4cfe11cf
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      Jellyfin.Server/Migrations/Routines/AddPeopleQueryIndex.cs

+ 3 - 3
Jellyfin.Server/Migrations/Routines/AddPeopleQueryIndex.cs

@@ -41,9 +41,9 @@ namespace Jellyfin.Server.Migrations.Routines
             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 idx_TypedBaseItemsUserDataKeyType ON TypedBaseItems(UserDataKey, Type);");
+            connection.Execute("CREATE INDEX IF NOT EXISTS idx_TypedBaseItemsUserDataKeyType ON TypedBaseItems(UserDataKey, Type);");
             _logger.LogInformation("Creating index idx_PeopleNameListOrder");
-            connection.Execute("CREATE INDEX idx_PeopleNameListOrder ON People(Name, ListOrder);");
+            connection.Execute("CREATE INDEX IF NOT EXISTS idx_PeopleNameListOrder ON People(Name, ListOrder);");
         }
     }
-}
+}