Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public abstract class AuditDbContext(DbContextOptions options) : DbContext(optio
{
public const string MigrationsHistoryTableName = "__AuditMigrationsHistory";

// EF Core's default history table name, which identifies a primary instance that wrongly shares this schema.
const string PrimaryMigrationsHistoryTableName = "__EFMigrationsHistory";
// The primary instance's migrations history table name, identified by ServiceControlDbContext.MigrationsHistoryTableName.
const string PrimaryMigrationsHistoryTableName = "__ErrorMigrationsHistory";

public string? Schema { get; } = options.FindExtension<SchemaOptionsExtension>()?.Schema;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public async Task Setup_fails_when_the_schema_holds_the_primary_migrations_histo

try
{
await TestSchema.CreateTable(connectionString, schema, "__EFMigrationsHistory");
await TestSchema.CreateTable(connectionString, schema, "__ErrorMigrationsHistory");

var exception = Assert.ThrowsAsync<InvalidOperationException>(() => Setup(testsConfiguration, connectionString, schema));

Assert.That(exception.Message, Does.Contain(schema).And.Contain("__EFMigrationsHistory"));
Assert.That(exception.Message, Does.Contain(schema).And.Contain("__ErrorMigrationsHistory"));
}
finally
{
Expand All @@ -62,7 +62,7 @@ public async Task Setup_ignores_the_primary_migrations_history_table_in_another_

try
{
await TestSchema.CreateTable(connectionString, primarySchema, "__EFMigrationsHistory");
await TestSchema.CreateTable(connectionString, primarySchema, "__ErrorMigrationsHistory");

Assert.DoesNotThrowAsync(() => Setup(testsConfiguration, connectionString, schema));
}
Expand Down
Loading