Skip to content

Commit 39e3871

Browse files
authored
Add custom journal table to UpgradeEngineBuilder (#19)
* Add custom journal table to UpgradeEngineBuilder * Updated surface area test +semver:minor
1 parent ffa1967 commit 39e3871

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName=".NET Standard 2.0")]
66
public static class MySqlExtensions
77
{
8+
public static DbUp.Builder.UpgradeEngineBuilder JournalToMySqlTable(this DbUp.Builder.UpgradeEngineBuilder builder, string schema, string table) { }
89
public static DbUp.Builder.UpgradeEngineBuilder MySqlDatabase(DbUp.Engine.Transactions.IConnectionManager connectionManager) { }
910
public static DbUp.Builder.UpgradeEngineBuilder MySqlDatabase(this DbUp.Builder.SupportedDatabases supported, DbUp.Engine.Transactions.IConnectionManager connectionManager) { }
1011
public static DbUp.Builder.UpgradeEngineBuilder MySqlDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString) { }

src/dbup-mysql/MySqlExtensions.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ public static UpgradeEngineBuilder MySqlDatabase(IConnectionManager connectionMa
8787
return builder;
8888
}
8989

90+
/// <summary>
91+
/// Tracks the list of executed scripts in a MySql table.
92+
/// </summary>
93+
/// <param name="builder">The builder.</param>
94+
/// <param name="schema">The schema.</param>
95+
/// <param name="table">The table.</param>
96+
/// <returns></returns>
97+
public static UpgradeEngineBuilder JournalToMySqlTable(this UpgradeEngineBuilder builder, string schema, string table)
98+
{
99+
builder.Configure(c => c.Journal = new MySqlTableJournal(() => c.ConnectionManager, () => c.Log, schema, table));
100+
return builder;
101+
}
102+
90103
/// <summary>
91104
/// Ensures that the database specified in the connection string exists.
92105
/// </summary>

0 commit comments

Comments
 (0)