Skip to content

Commit 3cd696e

Browse files
authoredDec 17, 2024··
Merge pull request #9 from DbUp/release/6.0.0
Release 6.0
2 parents d488659 + 8371cd1 commit 3cd696e

18 files changed

+77
-193
lines changed
 

‎.github/workflows/main.yml

+4-69
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,12 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- '**' # Ignores pushes of tags
57
pull_request:
68
workflow_dispatch:
79

810
jobs:
911
build:
10-
runs-on: windows-latest # Use Ubuntu in v5.0
11-
12-
env:
13-
DOTNET_NOLOGO: true
14-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Avoid pre-populating the NuGet package cache
15-
16-
steps:
17-
- uses: actions/checkout@v3
18-
with:
19-
fetch-depth: 0 # all
20-
21-
- name: Setup .NET 2.0 # Remove in v5.0
22-
uses: actions/setup-dotnet@v1
23-
with:
24-
dotnet-version: 2.0.x
25-
26-
- name: Setup .NET 8.0
27-
uses: actions/setup-dotnet@v1
28-
with:
29-
dotnet-version: 8.0.x
30-
31-
- name: Install GitVersion
32-
uses: gittools/actions/gitversion/setup@v0
33-
with:
34-
versionSpec: '5.x'
35-
36-
- name: Run GitVersion
37-
id: gitversion
38-
uses: gittools/actions/gitversion/execute@v0
39-
40-
- name: Display SemVer
41-
run: |
42-
echo "SemVer: $env:GitVersion_SemVer"
43-
44-
- name: Add DbUp NuGet Source
45-
run: dotnet nuget add source --name DbUp --username DbUp --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text https://nuget.pkg.github.com/DbUp/index.json
46-
47-
- name: Restore
48-
run: dotnet restore
49-
working-directory: src
50-
51-
- name: Build
52-
run: dotnet build -c Release --no-restore /p:Version=$env:GitVersion_SemVer
53-
working-directory: src
54-
55-
- name: Test
56-
run: dotnet test --no-build -c Release --logger trx --logger "console;verbosity=detailed" --results-directory ../artifacts
57-
working-directory: src
58-
59-
- name: Pack
60-
run: dotnet pack --no-build -c Release -o ../artifacts /p:Version=$env:GitVersion_SemVer
61-
working-directory: src
62-
63-
- name: Push NuGet packages to GitHub Packages ⬆️
64-
working-directory: artifacts
65-
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/DbUp/index.json"
66-
67-
- name: Push NuGet packages to NuGet ⬆️
68-
if: ${{ steps.gitversion.outputs.preReleaseLabel == '' }}
69-
working-directory: artifacts
70-
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json
71-
72-
- name: Test Report 🧪
73-
uses: dorny/test-reporter@v1
74-
if: ${{ always() }}
75-
with:
76-
name: Tests
77-
path: artifacts/*.trx
78-
reporter: dotnet-trx
12+
name: Build
13+
uses: DbUp/Universe/.github/workflows/build.yml@main

‎.github/workflows/publish-release.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Publish DbUp Packages to NuGet
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
name: Publish Package
11+
uses: DbUp/Universe/.github/workflows/publish-release.yml@main
12+
secrets: inherit

‎.github/workflows/test-report.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Test Report
2+
run-name: Generate Test Report for run `${{ github.event.workflow_run.run_number }}` branch `${{ github.event.workflow_run.head_branch }}`
3+
4+
on:
5+
workflow_run:
6+
workflows: ["CI", "build"]
7+
types: [completed]
8+
9+
jobs:
10+
report:
11+
name: Test Report 🧪
12+
uses: DbUp/Universe/.github/workflows/test-report.yml@main

‎src/Directory.Build.props

-14
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,4 @@
1010
<LangVersion>latest</LangVersion>
1111
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1212
</PropertyGroup>
13-
14-
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' Or '$(CI)' == 'true'">
15-
16-
<!-- Perform a deterministic build, so our binaries aren't impacted by build server environmental factors (e.g. file paths). -->
17-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
18-
19-
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
20-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
21-
22-
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) -->
23-
<DebugType>embedded</DebugType>
24-
25-
</PropertyGroup>
26-
2713
</Project>

‎src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyBasicSupport.verified.txt ‎src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyBasicSupport.approved.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
DB Operation: Open connection
22
Info: Beginning database upgrade
3-
Info: Checking whether journal table exists..
3+
Info: Checking whether journal table exists
44
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'SCHEMAVERSIONS'
55
DB Operation: Dispose command
66
Info: Journal table does not exist
77
Info: Executing Database Server script 'Script0001.sql'
8-
Info: Checking whether journal table exists..
8+
Info: Checking whether journal table exists
99
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'SCHEMAVERSIONS'
1010
DB Operation: Dispose command
1111
Info: Creating the "schemaversions" table

‎src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyJournalCreationIfNameChanged.verified.txt ‎src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyJournalCreationIfNameChanged.approved.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
DB Operation: Open connection
22
Info: Beginning database upgrade
3-
Info: Checking whether journal table exists..
3+
Info: Checking whether journal table exists
44
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'TESTSCHEMAVERSIONS'
55
DB Operation: Dispose command
66
Info: Journal table does not exist
77
Info: Executing Database Server script 'Script0001.sql'
8-
Info: Checking whether journal table exists..
8+
Info: Checking whether journal table exists
99
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'TESTSCHEMAVERSIONS'
1010
DB Operation: Dispose command
1111
Info: Creating the "test"."TestSchemaVersions" table

‎src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyVariableSubstitutions.verified.txt ‎src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyVariableSubstitutions.approved.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
DB Operation: Open connection
22
Info: Beginning database upgrade
3-
Info: Checking whether journal table exists..
3+
Info: Checking whether journal table exists
44
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'SCHEMAVERSIONS'
55
DB Operation: Dispose command
66
Info: Journal table does not exist
77
Info: Executing Database Server script 'Script0001.sql'
8-
Info: Checking whether journal table exists..
8+
Info: Checking whether journal table exists
99
DB Operation: Execute scalar command: select 1 from user_tables where table_name = 'SCHEMAVERSIONS'
1010
DB Operation: Dispose command
1111
Info: Creating the "schemaversions" table

‎src/Tests/ApprovalFiles/NoPublicApiChanges.Run.DotNet.verified.cs

-80
This file was deleted.

‎src/Tests/ApprovalFiles/NoPublicApiChanges.Run.Net.verified.cs ‎src/Tests/ApprovalFiles/NoPublicApiChanges.Run.approved.cs

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ protected override void ReadCustomStatement() { }
3333
}
3434
public static class OracleExtensions
3535
{
36+
public static DbUp.Builder.UpgradeEngineBuilder JournalToOracleTable(this DbUp.Builder.UpgradeEngineBuilder builder, string schema, string table) { }
3637
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(DbUp.Engine.Transactions.IConnectionManager connectionManager) { }
3738
[System.ObsoleteAttribute("Use OracleDatabaseWithDefaultDelimiter, OracleDatabaseWithSemicolonDelimiter or the OracleDatabase with the delimiter parameter instead, see https://github.com/DbUp/DbUp/pull/335")]
3839
public static DbUp.Builder.UpgradeEngineBuilder OracleDatabase(this DbUp.Builder.SupportedDatabases supported, string connectionString) { }

‎src/Tests/Tests.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;net8</TargetFrameworks>
4+
<TargetFramework>net8</TargetFramework>
55
<AssemblyName>Tests</AssemblyName>
66
<RootNamespace>DbUp.Oracle.Tests</RootNamespace>
7-
<!-- <ImplicitUsings>enable</ImplicitUsings> Can't use implict usings with net46 -->
7+
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
1212
<ProjectReference Include="..\dbup-oracle\dbup-oracle.csproj"/>
13-
<PackageReference Include="DbUp.Tests.Common" Version="5.0.37"/>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
15-
<PackageReference Include="xunit" Version="2.6.6"/>
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
13+
<PackageReference Include="DbUp.Tests.Common" Version="6.0.4" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
15+
<PackageReference Include="xunit" Version="2.9.2" />
16+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
1717
<PrivateAssets>all</PrivateAssets>
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
</PackageReference>

‎src/dbup-oracle.sln

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{77157734-01D
2323
ProjectSection(SolutionItems) = preProject
2424
.editorconfig = .editorconfig
2525
dbup-oracle.sln.DotSettings = dbup-oracle.sln.DotSettings
26+
Directory.Build.props = Directory.Build.props
2627
EndProjectSection
2728
EndProject
2829
Global

‎src/dbup-oracle.sln.DotSettings

+3
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQ/@EntryIndexedValue">SQ</s:String>
66
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
77
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
8+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
9+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
10+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
811
<s:String x:Key="/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue">&lt;data&gt;&lt;IncludeFilters /&gt;&lt;ExcludeFilters /&gt;&lt;/data&gt;</s:String>
912
<s:String x:Key="/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue">&lt;data /&gt;</s:String></wpf:ResourceDictionary>

‎src/dbup-oracle/OracleCommandReader.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public class OracleCommandReader : SqlCommandReader
2020
/// Hook to support custom statements
2121
/// </summary>
2222
protected override bool IsCustomStatement => TryPeek(DelimiterKeyword.Length, out var statement) &&
23-
string.Equals(DelimiterKeyword, statement, StringComparison.OrdinalIgnoreCase);
23+
string.Equals(DelimiterKeyword, statement, StringComparison.OrdinalIgnoreCase) &&
24+
string.IsNullOrEmpty(GetCurrentCommandTextFromBuffer());
2425

2526
/// <summary>
2627
/// Read a custom statement

‎src/dbup-oracle/OracleCustomDelimiterCommandReader.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Text;
33
using DbUp.Support;
44

@@ -20,7 +20,8 @@ public OracleCustomDelimiterCommandReader(string sqlText, char delimiter) : base
2020
/// </summary>
2121
protected override bool IsCustomStatement
2222
=> TryPeek(DelimiterKeyword.Length - 1, out var statement) &&
23-
string.Equals(DelimiterKeyword, CurrentChar + statement, StringComparison.OrdinalIgnoreCase);
23+
string.Equals(DelimiterKeyword, CurrentChar + statement, StringComparison.OrdinalIgnoreCase) &&
24+
string.IsNullOrEmpty(GetCurrentCommandTextFromBuffer());
2425

2526
/// <summary>
2627
/// Read a custom statement

‎src/dbup-oracle/OracleExtensions.cs

+13
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,19 @@ public static UpgradeEngineBuilder OracleDatabase(IConnectionManager connectionM
170170
builder.WithPreprocessor(new OraclePreprocessor());
171171
return builder;
172172
}
173+
174+
/// <summary>
175+
/// Tracks the list of executed scripts in an Oracle table.
176+
/// </summary>
177+
/// <param name="builder">The builder.</param>
178+
/// <param name="schema">The schema.</param>
179+
/// <param name="table">The table.</param>
180+
/// <returns></returns>
181+
public static UpgradeEngineBuilder JournalToOracleTable(this UpgradeEngineBuilder builder, string schema, string table)
182+
{
183+
builder.Configure(c => c.Journal = new OracleTableJournal(() => c.ConnectionManager, () => c.Log, schema, table));
184+
return builder;
185+
}
173186
}
174187
#pragma warning restore IDE0060 // Remove unused parameter
175188
}

‎src/dbup-oracle/OracleScriptExecutor.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScri
4747
}
4848
catch (OracleException exception)
4949
{
50-
Log().WriteInformation("Oracle exception has occurred in script: '{0}'", script.Name);
50+
Log().LogInformation("Oracle exception has occurred in script: '{0}'", script.Name);
5151
// OracleException.Number is the actual oracle error code
52-
Log().WriteError("Script block number: {0}; Oracle error code: {1}; Message: {2}", index, exception.Number, exception.Message);
53-
Log().WriteError(exception.ToString());
52+
Log().LogError("Script block number: {0}; Oracle error code: {1}; Message: {2}", index, exception.Number, exception.Message);
53+
Log().LogError(exception.ToString());
5454
throw;
5555
}
5656
}

0 commit comments

Comments
 (0)
Please sign in to comment.