mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
Do not crash sqlite migration if the db is create but without tables
This commit is contained in:
parent
2f88da67e8
commit
5790bed766
@ -183,7 +183,7 @@ namespace BTCPayServer.Hosting
|
||||
if (state == null)
|
||||
throw new ConfigException("This postgres database isn't created during a migration. Please use an empty database for postgres when migrating. If it's not a migration, remove --sqlitefile or --mysql settings.");
|
||||
}
|
||||
catch (NpgsqlException ex) when (ex.SqlState == PostgresErrorCodes.InvalidCatalogName) // DB doesn't exists
|
||||
catch (NpgsqlException ex) when (ex.SqlState == PostgresErrorCodes.InvalidCatalogName || ex.SqlState == PostgresErrorCodes.UndefinedTable) // DB doesn't exists
|
||||
{
|
||||
await postgresContext.Database.MigrateAsync();
|
||||
state = "pending";
|
||||
|
Loading…
Reference in New Issue
Block a user