Use local dotnet-ef tooling and strict EF migration checks
This commit is contained in:
@@ -2,7 +2,6 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using RpgRoller.Hosting;
|
||||
using RpgRoller.Data;
|
||||
|
||||
@@ -98,7 +97,6 @@ public sealed class HostingCoverageTests
|
||||
|
||||
var options = new DbContextOptionsBuilder<RpgRollerDbContext>()
|
||||
.UseSqlite(connectionString)
|
||||
.ConfigureWarnings(warnings => warnings.Ignore(RelationalEventId.PendingModelChangesWarning))
|
||||
.Options;
|
||||
|
||||
using (var db = new RpgRollerDbContext(options))
|
||||
@@ -125,5 +123,10 @@ public sealed class HostingCoverageTests
|
||||
historyCommand.CommandText = "SELECT COUNT(*) FROM \"__EFMigrationsHistory\" WHERE \"MigrationId\" = '20260226084000_InitialSchema';";
|
||||
var historyCount = Convert.ToInt32(historyCommand.ExecuteScalar());
|
||||
Assert.Equal(1, historyCount);
|
||||
|
||||
using var modelSyncHistoryCommand = verifyConnection.CreateCommand();
|
||||
modelSyncHistoryCommand.CommandText = "SELECT COUNT(*) FROM \"__EFMigrationsHistory\" WHERE \"MigrationId\" = '20260226090000_ModelSync';";
|
||||
var modelSyncHistoryCount = Convert.ToInt32(modelSyncHistoryCommand.ExecuteScalar());
|
||||
Assert.Equal(1, modelSyncHistoryCount);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user