Skip to content

Commit e2e0fad

Browse files
committed
Fix Migrations Issue
1 parent 0dfd027 commit e2e0fad

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Damselfly.Web.Server/Program.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using Serilog.Events;
2525
using ILogger = Serilog.ILogger;
2626
using Damselfly.Core.ScopedServices.Interfaces;
27+
using Microsoft.EntityFrameworkCore.Diagnostics;
2728

2829
namespace Damselfly.Web;
2930

@@ -113,12 +114,16 @@ private static void SetupDbContext(WebApplicationBuilder builder, DamselflyOptio
113114
var connectionString = $"Data Source={dbPath}";
114115

115116
// Add services to the container.
116-
builder.Services.AddDbContext<ImageContext>(options => options.UseSqlite(connectionString,
117-
b =>
118-
{
119-
b.MigrationsAssembly("Damselfly.Migrations.Sqlite");
120-
b.UseQuerySplittingBehavior(QuerySplittingBehavior.SingleQuery);
121-
}));
117+
builder.Services.AddDbContext<ImageContext>(options =>
118+
{
119+
options.ConfigureWarnings(warnings => warnings.Ignore(RelationalEventId.PendingModelChangesWarning));
120+
options.UseSqlite(connectionString,
121+
b =>
122+
{
123+
b.MigrationsAssembly("Damselfly.Migrations.Sqlite");
124+
b.UseQuerySplittingBehavior(QuerySplittingBehavior.SingleQuery);
125+
});
126+
});
122127
}
123128

124129
/// <summary>

0 commit comments

Comments
 (0)