case 4690 - AdminConnectionString: swap only the database via NpgsqlConnectionStringBuilder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 14:43:03 -07:00
parent 1ca07f1321
commit ab1a636ecb
2 changed files with 4 additions and 2 deletions

View File

@@ -96,7 +96,8 @@ namespace AyaNova.Util
{
get
{
return _dbConnectionString.Replace(_dbName, "postgres");
//Swap only the database, a text replace also changed a user, password or host containing the database name
return new Npgsql.NpgsqlConnectionStringBuilder(_dbConnectionString) { Database = "postgres" }.ConnectionString;
}
}