Skip to content

Commit

Permalink
Explicitly configure the MigrationsHistoryTable
Browse files Browse the repository at this point in the history
Otherwise the table is searched in another db schema in some cases.
  • Loading branch information
danjov committed Mar 7, 2024
1 parent 4b7777c commit cae4149
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@
builder.Services.AddScoped<DataService>();

var connectionString = builder.Configuration.GetConnectionString("BohrungContext");
builder.Services.AddDbContext<EwsContext>(x => x.UseNpgsql(connectionString, option => option.UseNetTopologySuite().UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery)));
builder.Services.AddDbContext<EwsContext>(x =>
{
x.UseNpgsql(connectionString, options =>
{
options.UseNetTopologySuite().UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
options.MigrationsHistoryTable("__EFMigrationsHistory", "bohrung");
});
});

AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);

var app = builder.Build();
Expand Down

0 comments on commit cae4149

Please sign in to comment.