diff --git a/src/Evolve/Evolve.cs b/src/Evolve/Evolve.cs index 0b40d53b..f80a227f 100644 --- a/src/Evolve/Evolve.cs +++ b/src/Evolve/Evolve.cs @@ -33,13 +33,14 @@ public class Evolve : IEvolveConfiguration /// /// The database connection used to apply the migrations. /// An optional logger. - public Evolve(DbConnection dbConnection, Action? logDelegate = null) + /// Optional default dbms + public Evolve(DbConnection dbConnection, Action? logDelegate = null, DBMS? dbms = null) { _userCnn = Check.NotNull(dbConnection, nameof(dbConnection)); _log = logDelegate ?? new Action((msg) => { }); using var evolveCnn = new WrappedConnection(_userCnn).Validate(); - DBMS = evolveCnn.GetDatabaseServerType(); + DBMS = dbms ?? evolveCnn.GetDatabaseServerType(); } #region IEvolveConfiguration diff --git a/test/Evolve.Tests/Integration/PostgreSQL/MigrationTest.cs b/test/Evolve.Tests/Integration/PostgreSQL/MigrationTest.cs index 1fb29c7c..e8f3dae2 100644 --- a/test/Evolve.Tests/Integration/PostgreSQL/MigrationTest.cs +++ b/test/Evolve.Tests/Integration/PostgreSQL/MigrationTest.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using EvolveDb.Dialect; using EvolveDb.Tests.Infrastructure; using Xunit; using Xunit.Abstractions; @@ -30,7 +31,7 @@ public void Run_all_PostgreSQL_migrations_work() // Arrange string[] locations = AppVeyor ? new[] { PostgreSQL.MigrationFolder } : new[] { PostgreSQL.MigrationFolder, PostgreSQL.Migration11Folder }; // Add specific PostgreSQL 11 scripts var cnn = _dbContainer.CreateDbConnection(); - var evolve = new Evolve(cnn, msg => _output.WriteLine(msg)) + var evolve = new Evolve(cnn, msg => _output.WriteLine(msg), DBMS.PostgreSQL) { Schemas = new[] { "public", "unittest" }, MetadataTableSchema = "unittest",