Skip to content

Commit

Permalink
try catch on migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob-SA committed Nov 15, 2024
1 parent 19d6ac7 commit e86d6e6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@
using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
dbContext.Database.Migrate();
try
{
// Drop the database schema
// dbContext.Database.EnsureDeleted();
dbContext.Database.Migrate();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}

// Configure the HTTP request pipeline.
Expand Down

0 comments on commit e86d6e6

Please sign in to comment.