Skip to content

Commit d69847a

Browse files
authored
v2.5.3 (#54)
- *Fixed:* Updated `CoreEx` to version `3.20.0`. - *Fixed:* Fixed logging of SQL statements to include the source: `FILE`, `RES` (embedded resource) or `SQL` (specified statement).
1 parent a1928b8 commit d69847a

File tree

8 files changed

+17
-11
lines changed

8 files changed

+17
-11
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Represents the **NuGet** versions.
44

5+
## v2.5.3
6+
- *Fixed:* Updated `CoreEx` to version `3.20.0`.
7+
- *Fixed:* Fixed logging of SQL statements to include the source: `FILE`, `RES` (embedded resource) or `SQL` (specified statement).
8+
59
## v2.5.2
610
- *Fixed:* Updated `CoreEx` to version `3.18.0`.
711
- Includes removal of `Azure.Identity` dependency; related to `https://github.com/advisories/GHSA-wvxc-855f-jvrv`.

Common.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>2.5.2</Version>
3+
<Version>2.5.3</Version>
44
<LangVersion>preview</LangVersion>
55
<Authors>Avanade</Authors>
66
<Company>Avanade</Company>

src/DbEx.MySql/DbEx.MySql.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</ItemGroup>
4242

4343
<ItemGroup>
44-
<PackageReference Include="CoreEx.Database.MySql" Version="3.18.0" />
44+
<PackageReference Include="CoreEx.Database.MySql" Version="3.20.0" />
4545
<PackageReference Include="dbup-mysql" Version="5.0.44" />
4646
</ItemGroup>
4747

src/DbEx.Postgres/DbEx.Postgres.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</ItemGroup>
4343

4444
<ItemGroup>
45-
<PackageReference Include="CoreEx.Database.Postgres" Version="3.18.0" />
45+
<PackageReference Include="CoreEx.Database.Postgres" Version="3.20.0" />
4646
<PackageReference Include="dbup-postgresql" Version="5.0.40" />
4747
</ItemGroup>
4848

src/DbEx.SqlServer/DbEx.SqlServer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</ItemGroup>
3333

3434
<ItemGroup>
35-
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.18.0" />
35+
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.20.0" />
3636
<PackageReference Include="dbup-sqlserver" Version="5.0.40" />
3737
</ItemGroup>
3838

src/DbEx/DbEx.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="CoreEx.Database" Version="3.18.0" />
23+
<PackageReference Include="CoreEx.Database" Version="3.20.0" />
2424
<PackageReference Include="OnRamp" Version="2.2.0" />
2525
</ItemGroup>
2626

src/DbEx/Migration/DatabaseMigrationBase.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ protected virtual async Task<bool> ExecuteScriptsAsync(IEnumerable<DatabaseMigra
343343
}
344344

345345
if (includeExecutionLogging)
346-
Logger.LogInformation("{Content}", $" {script.Name}{(string.IsNullOrEmpty(script.Tag) ? "" : $" > {script.Tag}")}");
346+
Logger.LogInformation("{Content}", $" {script.Name} ({script.Source}){(string.IsNullOrEmpty(script.Tag) ? "" : $" > {script.Tag}")}");
347347

348348
try
349349
{
@@ -748,7 +748,7 @@ private async Task<bool> DatabaseDataAsync(CancellationToken cancellationToken)
748748
Logger.LogInformation("{Content}", $"** Executing: {item.ResourceName}");
749749

750750
var ss = new DatabaseMigrationScript(this, item.Assembly, item.ResourceName) { RunAlways = true };
751-
if (!await ExecuteScriptsAsync(new DatabaseMigrationScript[] { ss }, false, cancellationToken).ConfigureAwait(false))
751+
if (!await ExecuteScriptsAsync([ss], false, cancellationToken).ConfigureAwait(false))
752752
return false;
753753
}
754754
else
@@ -865,7 +865,6 @@ public async Task<bool> CreateScriptAsync(string? name = null, IDictionary<strin
865865
/// </summary>
866866
private async Task<bool> CreateScriptInternalAsync(string? name, IDictionary<string, string?>? parameters, CancellationToken cancellationToken)
867867
{
868-
869868
name ??= "Default";
870869
var rn = $"Script{name}_sql";
871870

src/DbEx/Migration/DatabaseMigrationScript.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/DbEx
22

33
using CoreEx;
4-
using System;
54
using System.IO;
65
using System.Reflection;
76
using System.Text;
@@ -47,9 +46,8 @@ public DatabaseMigrationScript(DatabaseMigrationBase databaseMigation, Assembly
4746
/// Initializes a new instance of the <see cref="DatabaseMigrationScript"/> class for the specified <paramref name="sql"/>.
4847
/// </summary>
4948
/// <param name="databaseMigation">The owning <see cref="DatabaseMigrationBase"/>.</param>
50-
/// <param name="sql"></param>
49+
/// <param name="sql">The SQL statement.</param>
5150
/// <param name="name">The sql name.</param>
52-
/// <exception cref="ArgumentNullException"></exception>
5351
public DatabaseMigrationScript(DatabaseMigrationBase databaseMigation, string sql, string name)
5452
{
5553
DatabaseMigration = databaseMigation.ThrowIfNull(nameof(databaseMigation));
@@ -83,6 +81,11 @@ public DatabaseMigrationScript(DatabaseMigrationBase databaseMigation, string sq
8381
/// </summary>
8482
public string? Tag { get; set; }
8583

84+
/// <summary>
85+
/// Gets the underlying SQL statement source.
86+
/// </summary>
87+
public string Source => _assembly is not null ? "RES" : (_file is not null ? "FILE" : "SQL");
88+
8689
/// <summary>
8790
/// Gets the resource or file <see cref="System.IO.StreamReader"/>.
8891
/// </summary>

0 commit comments

Comments
 (0)