Skip to content

Commit

Permalink
fix #300
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonyCorbett committed Dec 12, 2019
1 parent 82d173b commit 48bcbc9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions OnlyM.Core/Services/Database/DatabaseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,19 @@ private void DeleteDatabase()

private int GetDatabaseSchemaVersion()
{
using (var c = CreateConnection())
using (var cmd = c.CreateCommand())
try
{
using (var c = CreateConnection())
using (var cmd = c.CreateCommand())
{
cmd.CommandText = "select * from pragma_user_version()";
return Convert.ToInt32(cmd.ExecuteScalar());
}
}
catch (Exception ex)
{
cmd.CommandText = "select * from pragma_user_version()";
return Convert.ToInt32(cmd.ExecuteScalar());
Log.Logger.Error(ex, "Could not get database schema version");
return 0;
}
}

Expand Down
2 changes: 1 addition & 1 deletion SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.5.0.22")]
[assembly: AssemblyVersion("1.5.0.23")]

0 comments on commit 48bcbc9

Please sign in to comment.