Skip to content

Commit

Permalink
Fixed collation on Connection String not being used when upgrading
Browse files Browse the repository at this point in the history
  • Loading branch information
lbnascimento committed Jul 2, 2020
1 parent abe624e commit ce30aee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LiteDB/Client/Database/LiteDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public LiteDatabase(ConnectionString connectionString, BsonMapper mapper = null)
if (connectionString.Upgrade == true)
{
// try upgrade if need
LiteEngine.Upgrade(connectionString.Filename, connectionString.Password);
LiteEngine.Upgrade(connectionString.Filename, connectionString.Password, connectionString.Collation);
}

_engine = connectionString.CreateEngine();
Expand Down
5 changes: 3 additions & 2 deletions LiteDB/Engine/Engine/Upgrade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ public partial class LiteEngine
/// Upgrade old version of LiteDB into new LiteDB file structure. Returns true if database was completed converted
/// If database already in current version just return false
/// </summary>
public static bool Upgrade(string filename, string password = null)
public static bool Upgrade(string filename, string password = null, Collation collation = null)
{
if (filename.IsNullOrWhiteSpace()) throw new ArgumentNullException(nameof(filename));
if (!File.Exists(filename)) return false;

var settings = new EngineSettings
{
Filename = filename,
Password = password
Password = password,
Collation = collation
};

var backup = FileHelper.GetSufixFile(filename, "-backup", true);
Expand Down

1 comment on commit ce30aee

@lbnascimento
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for #1740

Please sign in to comment.