瀏覽代碼

Moved VACUUM down to the end of the list.

Erwin de Haan 6 年之前
父節點
當前提交
7587fe56d8
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Emby.Server.Implementations/Data/BaseSqliteRepository.cs

+ 3 - 2
Emby.Server.Implementations/Data/BaseSqliteRepository.cs

@@ -202,8 +202,7 @@ namespace Emby.Server.Implementations.Data
         protected void RunDefaultInitialization(ManagedConnection db)
         {
             var queries = new List<string>
-            {
-                "VACUUM",
+            {                
                 "PRAGMA journal_mode=WAL",
                 "PRAGMA page_size=4096",
                 "PRAGMA synchronous=Normal"
@@ -224,6 +223,8 @@ namespace Emby.Server.Implementations.Data
                     "pragma temp_store = file"
                 });
             }
+            // Configuration and pragmas can affect VACUUM so it needs to be last.
+            queries.Add("VACUUM");
 
             db.ExecuteAll(string.Join(";", queries));
             Logger.LogInformation("PRAGMA synchronous=" + db.Query("PRAGMA synchronous").SelectScalarString().First());