From b2f60d4560073a555d3e80f6ace83f1bb83136fe Mon Sep 17 00:00:00 2001 From: cesnimda Date: Sat, 21 Mar 2026 12:31:10 +0100 Subject: [PATCH] Fix Database migratioon on build --- JobTrackerApi/Program.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/JobTrackerApi/Program.cs b/JobTrackerApi/Program.cs index 4c31f95..1fa4e73 100644 --- a/JobTrackerApi/Program.cs +++ b/JobTrackerApi/Program.cs @@ -327,6 +327,8 @@ using (var scope = app.Services.CreateScope()) static void EnsureColumn(DbConnection c, string table, string column, string ddl) { + // Fresh databases won't have the table until EF migrations run. + if (!HasTable(c, table)) return; if (!HasColumn(c, table, column)) Exec(c, ddl); }