Skip to content

Commit

Permalink
Merge pull request #338 from GeoWerkstatt/ef-migration-history-table
Browse files Browse the repository at this point in the history
Explicitly configure the MigrationsHistoryTable
  • Loading branch information
danjov authored Mar 7, 2024
2 parents 4b7777c + cae4149 commit c17b16f
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 c17b16f

Please sign in to comment.