Skip to content

Commit 56d8911

Browse files
fix(#26): avoid NullReferenceException when creating database (#27)
* fix(#26): avoid NullReferenceException when creating database * Updated approval file --------- Co-authored-by: Robert Wagner <[email protected]>
1 parent 5fb1a06 commit 56d8911

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Tests/ApprovalFiles/NoPublicApiChanges.Run.approved.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public static void PostgresqlDatabase(this DbUp.SupportedDatabasesForEnsureDatab
1616
public static void PostgresqlDatabase(this DbUp.SupportedDatabasesForEnsureDatabase supported, string connectionString, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate) { }
1717
public static void PostgresqlDatabase(this DbUp.SupportedDatabasesForEnsureDatabase supported, string connectionString, DbUp.Postgresql.PostgresqlConnectionOptions connectionOptions) { }
1818
public static void PostgresqlDatabase(this DbUp.SupportedDatabasesForEnsureDatabase supported, string connectionString, DbUp.Engine.Output.IUpgradeLog logger) { }
19+
public static void PostgresqlDatabase(this DbUp.SupportedDatabasesForEnsureDatabase supported, string connectionString, DbUp.Engine.Output.IUpgradeLog logger, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate) { }
20+
public static void PostgresqlDatabase(this DbUp.SupportedDatabasesForEnsureDatabase supported, string connectionString, DbUp.Engine.Output.IUpgradeLog logger, DbUp.Postgresql.PostgresqlConnectionOptions connectionOptions) { }
1921
}
2022
namespace DbUp.Postgresql
2123
{

src/dbup-postgresql/PostgresqlExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ public static void PostgresqlDatabase(this SupportedDatabasesForEnsureDatabase s
147147
/// <returns></returns>
148148
public static void PostgresqlDatabase(this SupportedDatabasesForEnsureDatabase supported, string connectionString, IUpgradeLog logger)
149149
{
150-
PostgresqlDatabase(supported, connectionString, logger, (PostgresqlConnectionOptions)null);
150+
PostgresqlDatabase(supported, connectionString, logger, new PostgresqlConnectionOptions());
151151
}
152-
153-
private static void PostgresqlDatabase(this SupportedDatabasesForEnsureDatabase supported, string connectionString, IUpgradeLog logger, X509Certificate2 certificate)
152+
153+
public static void PostgresqlDatabase(this SupportedDatabasesForEnsureDatabase supported, string connectionString, IUpgradeLog logger, X509Certificate2 certificate)
154154
{
155155
var options = new PostgresqlConnectionOptions
156156
{
@@ -159,7 +159,7 @@ private static void PostgresqlDatabase(this SupportedDatabasesForEnsureDatabase
159159
PostgresqlDatabase(supported, connectionString, logger, options);
160160
}
161161

162-
private static void PostgresqlDatabase(
162+
public static void PostgresqlDatabase(
163163
this SupportedDatabasesForEnsureDatabase supported,
164164
string connectionString,
165165
IUpgradeLog logger,

0 commit comments

Comments
 (0)