After successful migration from SQLite or MySql, there is an error after a restart

This commit is contained in:
nicolas.dorier 2023-02-11 21:01:36 +09:00
parent d14ce2a37f
commit 8c6fe91c71
No known key found for this signature in database
GPG key ID: 6618763EF09186FE
3 changed files with 11 additions and 2 deletions

View file

@ -242,7 +242,10 @@ namespace BTCPayServer.Hosting
private static async Task<string?> GetMigrationState(ApplicationDbContext postgresContext) private static async Task<string?> GetMigrationState(ApplicationDbContext postgresContext)
{ {
return (await postgresContext.Settings.FromSqlRaw("SELECT \"Id\", \"Value\" FROM \"Settings\" WHERE \"Id\"='MigrationData'").AsNoTracking().FirstOrDefaultAsync())?.Value; var o = (await postgresContext.Settings.FromSqlRaw("SELECT \"Id\", \"Value\" FROM \"Settings\" WHERE \"Id\"='MigrationData'").AsNoTracking().FirstOrDefaultAsync())?.Value;
if (o is null)
return null;
return JObject.Parse(o)["state"]?.Value<string>();
} }
private static async Task SetMigrationState(ApplicationDbContext postgresContext, string migratingFrom, string state) private static async Task SetMigrationState(ApplicationDbContext postgresContext, string migratingFrom, string state)
{ {

View file

@ -1,5 +1,5 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>1.7.9</Version> <Version>1.7.10</Version>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View file

@ -1,5 +1,11 @@
# Changelog # Changelog
## 1.7.10
### Bug fix
* After successful migration from SQLite or MySql, there is an error after a restart @NicolasDorier
## 1.7.9 ## 1.7.9
### Bug fixes ### Bug fixes