Skip to content

Commit 1870e3f

Browse files
authored
Merge pull request #8 from DbUp/core6
Update dependencies and build to the latest
2 parents f3cfc2a + bb5cc65 commit 1870e3f

17 files changed

+56
-230
lines changed

src/Directory.Build.props

Lines changed: 0 additions & 14 deletions
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/Sample/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,17 @@ static void Display(string dbType, DbUp.Engine.DatabaseUpgradeResult result, Tim
8787
"{0} Database Upgrade Runtime: {1}",
8888
dbType,
8989
string.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10));
90+
Console.WriteLine("Press any key to continue...");
9091
Console.ReadKey();
9192
}
9293
else
9394
{
9495
Console.ForegroundColor = ConsoleColor.Red;
9596
Console.WriteLine(result.Error);
97+
Console.WriteLine("Press any key to continue...");
9698
Console.ReadKey();
9799
Console.WriteLine("Failed!");
98100
}
99101
}
100102
}
101-
}
103+
}

src/Sample/Sample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net8</TargetFramework>
44
<OutputType>Exe</OutputType>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>

src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyBasicSupport.verified.txt renamed to src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyBasicSupport.approved.txt

Lines changed: 2 additions & 2 deletions
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 count(name) FROM sqlite_master WHERE type = 'table' AND 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 count(name) FROM sqlite_master WHERE type = 'table' AND name = 'SchemaVersions'
1010
DB Operation: Dispose command
1111
Info: Creating the [SchemaVersions] table
Lines changed: 2 additions & 2 deletions
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 count(name) FROM sqlite_master WHERE type = 'table' AND 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 count(name) FROM sqlite_master WHERE type = 'table' AND name = 'TestSchemaVersions'
1010
DB Operation: Dispose command
1111
Info: Creating the [TestSchemaVersions] table

src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyVariableSubstitutions.verified.txt renamed to src/Tests/ApprovalFiles/DatabaseSupportTests.VerifyVariableSubstitutions.approved.txt

Lines changed: 2 additions & 2 deletions
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 count(name) FROM sqlite_master WHERE type = 'table' AND 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 count(name) FROM sqlite_master WHERE type = 'table' AND name = 'SchemaVersions'
1010
DB Operation: Dispose command
1111
Info: Creating the [SchemaVersions] table

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

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/Tests/ApprovalFiles/NoPublicApiChanges.Run.Net.verified.cs renamed to src/Tests/ApprovalFiles/NoPublicApiChanges.Run.approved.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public class TemporarySQLiteDatabase : System.IDisposable
7171
public TemporarySQLiteDatabase(string name) { }
7272
public DbUp.SQLite.Helpers.SharedConnection SharedConnection { get; }
7373
public DbUp.Helpers.AdHocSqlRunner SqlRunner { get; }
74-
public void Create() { }
7574
public void Dispose() { }
7675
}
7776
}

src/Tests/SQLiteSupportTests.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
#if !NETCORE
2-
using System;
3-
using System.Data.SQLite;
4-
using System.IO;
1+
using Microsoft.Data.Sqlite;
2+
using Shouldly;
53
using Xunit;
64

75
namespace DbUp.SQLite.Tests
@@ -13,18 +11,17 @@ public class SQLiteSupportTests
1311
[Fact]
1412
public void CanUseSQLite()
1513
{
16-
var connectionString = string.Format("Data Source={0}; Version=3;", dbFilePath);
17-
18-
if (!File.Exists(dbFilePath))
19-
{
20-
SQLiteConnection.CreateFile(dbFilePath);
21-
}
14+
var connectionString = $"Data Source={dbFilePath}";
2215

2316
var upgrader = DeployChanges.To
2417
.SQLiteDatabase(connectionString)
2518
.WithScript("Script0001", "CREATE TABLE IF NOT EXISTS Foo (Id int)")
2619
.Build();
20+
21+
var result = upgrader.PerformUpgrade();
22+
23+
result.Error.ShouldBe(null);
24+
result.Successful.ShouldBe(true);
2725
}
2826
}
2927
}
30-
#endif

src/Tests/SQLiteTableJournalTests.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
#if !NETCORE
2-
using System.Collections.Generic;
3-
using System.Data;
4-
using System.Data.SQLite;
1+
using System.Data;
52
using DbUp.Engine;
63
using DbUp.Engine.Output;
74
using DbUp.Engine.Transactions;
85
using DbUp.Tests.Common;
6+
using Microsoft.Data.Sqlite;
97
using NSubstitute;
108
using Shouldly;
119
using Xunit;
@@ -22,7 +20,7 @@ public void dbversion_is_zero_when_journal_table_not_exist()
2220
var command = Substitute.For<IDbCommand>();
2321
dbConnection.CreateCommand().Returns(command);
2422
var connectionManager = Substitute.For<IConnectionManager>();
25-
command.ExecuteScalar().Returns(x => { throw new SQLiteException("table not found"); });
23+
command.ExecuteScalar().Returns(x => { throw new SqliteException("table not found", 0); });
2624
var consoleUpgradeLog = new ConsoleUpgradeLog();
2725
var journal = new SQLiteTableJournal(() => connectionManager, () => consoleUpgradeLog, "SchemaVersions");
2826

@@ -62,4 +60,3 @@ public void creates_a_new_journal_table_when_not_exist()
6260
}
6361
}
6462
}
65-
#endif

0 commit comments

Comments
 (0)