From 108e8f83d08b31cb9818397b96d0f54b32ebc3b5 Mon Sep 17 00:00:00 2001 From: Markus Keil Date: Sat, 27 Jul 2024 09:56:49 +0200 Subject: [PATCH] make sure to run db migrations on sdtartup --- Program.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Program.cs b/Program.cs index 5595ac0..e98a84e 100644 --- a/Program.cs +++ b/Program.cs @@ -89,6 +89,15 @@ public static void Main(string[] args) } } + // Database migration + Log.Information("Running Database migrations..."); + using (var db = new ActionsRunnerContext()) + { + db.Database.Migrate(); + } + Log.Information("Migrations complete."); + + WebApplicationBuilder builder = WebApplication.CreateBuilder(args); builder.Services.AddSerilog(); builder.Services.AddSingleton();