Skip to content

Commit 8a0d508

Browse files
committed
fix(tests): fix CI integration test failures — add missing migrations and fix provisioning
- Add SyncModel migrations for IdentityDbContext (UserSessions index) and AuditDbContext (TenantId column type) — EF Core 10 blocked MigrateAsync with "pending model changes" warning, preventing tenant provisioning - Remove OutboxDispatcherHostedService in test factory — it queries OutboxMessages before migrations complete, causing startup errors - Fix provisioning status endpoint path: /{tenantId}/provisioning (not /status) - Add login retry for new tenant admin in isolation tests — provisioning may still be finalizing when the login attempt fires
1 parent 5807b9f commit 8a0d508

File tree

8 files changed

+1187
-260
lines changed

8 files changed

+1187
-260
lines changed

src/Playground/Migrations.PostgreSQL/Audit/20260403185410_SyncModel.Designer.cs

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
3+
#nullable disable
4+
5+
namespace FSH.Migrations.PostgreSQL.Audit
6+
{
7+
/// <inheritdoc />
8+
public partial class SyncModel : Migration
9+
{
10+
/// <inheritdoc />
11+
protected override void Up(MigrationBuilder migrationBuilder)
12+
{
13+
migrationBuilder.AlterColumn<string>(
14+
name: "TenantId",
15+
schema: "audit",
16+
table: "AuditRecords",
17+
type: "text",
18+
nullable: false,
19+
oldClrType: typeof(string),
20+
oldType: "character varying(64)",
21+
oldMaxLength: 64);
22+
}
23+
24+
/// <inheritdoc />
25+
protected override void Down(MigrationBuilder migrationBuilder)
26+
{
27+
migrationBuilder.AlterColumn<string>(
28+
name: "TenantId",
29+
schema: "audit",
30+
table: "AuditRecords",
31+
type: "character varying(64)",
32+
maxLength: 64,
33+
nullable: false,
34+
oldClrType: typeof(string),
35+
oldType: "text");
36+
}
37+
}
38+
}

src/Playground/Migrations.PostgreSQL/Audit/AuditDbContextModelSnapshot.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
1717
{
1818
#pragma warning disable 612, 618
1919
modelBuilder
20-
.HasAnnotation("ProductVersion", "10.0.0")
20+
.HasAnnotation("ProductVersion", "10.0.5")
2121
.HasAnnotation("Relational:MaxIdentifierLength", 63);
2222

2323
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@@ -61,8 +61,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
6161

6262
b.Property<string>("TenantId")
6363
.IsRequired()
64-
.HasMaxLength(64)
65-
.HasColumnType("character varying(64)");
64+
.HasColumnType("text");
6665

6766
b.Property<string>("TraceId")
6867
.HasColumnType("text");

0 commit comments

Comments
 (0)