Skip to content

Commit

Permalink
Add logging for db migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Sep 10, 2024
1 parent daad59b commit d2a9185
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Gameboard.Api/Extensions/DatabaseStartupExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ public static WebApplication InitializeDatabase(this WebApplication app, AppSett
var config = services.GetRequiredService<IConfiguration>();
var env = services.GetService<IWebHostEnvironment>();

logger.LogInformation($"Migrating database...");
using var dbContext = services.GetService<GameboardDbContext>();
dbContext.Database.Migrate();
logger.LogInformation($"Database migrated!");
SeedDatabase(env, config, dbContext, settings, logger);

return app;
Expand Down

0 comments on commit d2a9185

Please sign in to comment.