-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2499 from jdtkw/master
Addresses issue of upgrading from v4.x databases in LiteDB versions 5.0.18-5.0.20
- Loading branch information
Showing
6 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Xunit; | ||
|
||
namespace LiteDB.Tests.Issues; | ||
|
||
public class Issue2494_Tests | ||
{ | ||
[Fact] | ||
public static void Test() | ||
{ | ||
var original = "../../../Resources/Issue_2494_EncryptedV4.db"; | ||
using var filename = new TempFile(original); | ||
|
||
var connectionString = new ConnectionString(filename) | ||
{ | ||
Password = "pass123", | ||
Upgrade = true, | ||
}; | ||
|
||
using (var db = new LiteDatabase(connectionString)) // <= throws as of version 5.0.18 | ||
{ | ||
var col = db.GetCollection<PlayerDto>(); | ||
col.FindAll(); | ||
} | ||
} | ||
|
||
public class PlayerDto | ||
{ | ||
[BsonId] | ||
public Guid Id { get; set; } | ||
|
||
public string Name { get; set; } | ||
|
||
public PlayerDto(Guid id, string name) | ||
{ | ||
Id = id; | ||
Name = name; | ||
} | ||
|
||
public PlayerDto() | ||
{ | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters