diff --git a/src/MonkeyCache.LiteDB/Barrel.cs b/src/MonkeyCache.LiteDB/Barrel.cs index a18b46f..716810c 100644 --- a/src/MonkeyCache.LiteDB/Barrel.cs +++ b/src/MonkeyCache.LiteDB/Barrel.cs @@ -15,6 +15,7 @@ public class Barrel : IBarrel { public static string ApplicationId { get; set; } = string.Empty; public static string EncryptionKey { get; set; } = string.Empty; + public static bool Upgrade { get; set; } = false; static readonly Lazy baseCacheDir = new Lazy(() => { @@ -64,6 +65,8 @@ public static IBarrel Create(string cacheDirectory, bool cache = false) if (!string.IsNullOrWhiteSpace(EncryptionKey)) path = $"Filename={path}; Password={EncryptionKey}"; #endif + if(Upgrade) + path += "; Upgrade=true"; db = new LiteDatabase(path); col = db.GetCollection(); @@ -301,4 +304,4 @@ public void Empty(params string[] key) } #endregion } -} \ No newline at end of file +} diff --git a/src/MonkeyCache.LiteDB/MonkeyCache.LiteDB.csproj b/src/MonkeyCache.LiteDB/MonkeyCache.LiteDB.csproj index 7fc68c1..e7d4432 100644 --- a/src/MonkeyCache.LiteDB/MonkeyCache.LiteDB.csproj +++ b/src/MonkeyCache.LiteDB/MonkeyCache.LiteDB.csproj @@ -62,6 +62,7 @@ + diff --git a/src/MonkeyCache.TestApp.Android/MonkeyCache.TestApp.Android.csproj b/src/MonkeyCache.TestApp.Android/MonkeyCache.TestApp.Android.csproj index 4dcbb18..ef75477 100644 --- a/src/MonkeyCache.TestApp.Android/MonkeyCache.TestApp.Android.csproj +++ b/src/MonkeyCache.TestApp.Android/MonkeyCache.TestApp.Android.csproj @@ -108,4 +108,4 @@ - \ No newline at end of file + diff --git a/src/MonkeyCache.TestApp.UWP/MonkeyCache.TestApp.UWP.csproj b/src/MonkeyCache.TestApp.UWP/MonkeyCache.TestApp.UWP.csproj index 9e83a52..bd4d446 100644 --- a/src/MonkeyCache.TestApp.UWP/MonkeyCache.TestApp.UWP.csproj +++ b/src/MonkeyCache.TestApp.UWP/MonkeyCache.TestApp.UWP.csproj @@ -183,4 +183,4 @@ 14.0 - \ No newline at end of file + diff --git a/src/MonkeyCache.TestApp/MonkeyCache.TestApp.csproj b/src/MonkeyCache.TestApp/MonkeyCache.TestApp.csproj index 8048718..3b4e6f1 100644 --- a/src/MonkeyCache.TestApp/MonkeyCache.TestApp.csproj +++ b/src/MonkeyCache.TestApp/MonkeyCache.TestApp.csproj @@ -25,4 +25,4 @@ *.xaml - \ No newline at end of file +