Merge hands/mill-votes-cut-0a: the live migration-discovery fix on main
Concept Mill votes Cut 0a (concept-mill-votes:cut_report:cut-0a.h1), held by
Soul (concept-mill-votes:verdict:cut-0a.s1). daedcc4, the live release, is now
an ancestor of main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
837bc11a15
8 changed files with 73 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
|
@ -5,6 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DbContext(typeof(BifrostDbContext))]
|
||||
[Migration("20260608210000_AddHeimdallUserIdentity")]
|
||||
public partial class AddHeimdallUserIdentity : Migration
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
|
@ -5,6 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DbContext(typeof(BifrostDbContext))]
|
||||
[Migration("20260609143000_AddPatronSupportDerivation")]
|
||||
public partial class AddPatronSupportDerivation : Migration
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
using Bifrost.Web.Domain;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(BifrostDbContext))]
|
||||
[Migration("20260609160000_AddExternalPatronProviderIntake")]
|
||||
public partial class AddExternalPatronProviderIntake : Migration
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
|
@ -5,6 +6,8 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DbContext(typeof(BifrostDbContext))]
|
||||
[Migration("20260622142000_AddBridgeActionIdentityProvenance")]
|
||||
public partial class AddBridgeActionIdentityProvenance : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
|
@ -5,6 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DbContext(typeof(BifrostDbContext))]
|
||||
[Migration("20260622165000_AddBifrostNativeIdentity")]
|
||||
public partial class AddBifrostNativeIdentity : Migration
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
|
@ -5,6 +6,8 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DbContext(typeof(BifrostDbContext))]
|
||||
[Migration("20260622202000_AddBridgeActionTargetSurfaceName")]
|
||||
public partial class AddBridgeActionTargetSurfaceName : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
|
@ -6,6 +7,8 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DbContext(typeof(BifrostDbContext))]
|
||||
[Migration("20260705190000_AddPatronSupportProjectAttribution")]
|
||||
public partial class AddPatronSupportProjectAttribution : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
56
tests/Bifrost.Web.Tests/MigrationDiscoveryTests.cs
Normal file
56
tests/Bifrost.Web.Tests/MigrationDiscoveryTests.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
using Bifrost.Web.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Bifrost.Web.Tests;
|
||||
|
||||
public sealed class MigrationDiscoveryTests
|
||||
{
|
||||
private static readonly string[] ExpectedMigrations =
|
||||
[
|
||||
"20260422084653_InitialAlphaFoundation",
|
||||
"20260608210000_AddHeimdallUserIdentity",
|
||||
"20260609143000_AddPatronSupportDerivation",
|
||||
"20260609160000_AddExternalPatronProviderIntake",
|
||||
"20260617010537_AddBridgeActionLedger",
|
||||
"20260617022305_AddAgentDispatchRuns",
|
||||
"20260617033635_AddAgentTransportReceipts",
|
||||
"20260617041417_AddGovernanceActivityReceipts",
|
||||
"20260622142000_AddBridgeActionIdentityProvenance",
|
||||
"20260622165000_AddBifrostNativeIdentity",
|
||||
"20260622202000_AddBridgeActionTargetSurfaceName",
|
||||
"20260705190000_AddPatronSupportProjectAttribution",
|
||||
];
|
||||
|
||||
// Database.GetMigrations() reads assembly metadata only; no connection is opened.
|
||||
private static List<string> Discovered()
|
||||
{
|
||||
var options = new DbContextOptionsBuilder<BifrostDbContext>()
|
||||
.UseNpgsql("Host=unused")
|
||||
.Options;
|
||||
using var db = new BifrostDbContext(options);
|
||||
return db.Database.GetMigrations().ToList();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Every_migration_type_is_discovered()
|
||||
{
|
||||
var discovered = Discovered();
|
||||
var declared = typeof(BifrostDbContext).Assembly.GetTypes()
|
||||
.Where(t => !t.IsAbstract && typeof(Migration).IsAssignableFrom(t))
|
||||
.ToList();
|
||||
|
||||
Assert.NotEmpty(declared);
|
||||
Assert.Equal(declared.Count, discovered.Count);
|
||||
foreach (var type in declared)
|
||||
{
|
||||
Assert.Contains(discovered, id => id.EndsWith("_" + type.Name, StringComparison.Ordinal));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void All_twelve_migrations_are_listed_in_order()
|
||||
{
|
||||
Assert.Equal(ExpectedMigrations, Discovered());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue