From d08c7df1bb4d99fbe8ab49de0630892fa807852f Mon Sep 17 00:00:00 2001 From: DAQEM Date: Mon, 15 Jan 2024 00:45:22 +0100 Subject: [PATCH] Fixed Migrations Issue --- Services/Netmon.DeviceManager/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Services/Netmon.DeviceManager/Program.cs b/Services/Netmon.DeviceManager/Program.cs index 076d65f..728d79b 100644 --- a/Services/Netmon.DeviceManager/Program.cs +++ b/Services/Netmon.DeviceManager/Program.cs @@ -205,6 +205,12 @@ using (IServiceScope scope = app.Services.CreateScope()) { + DevicesDatabase database = scope.ServiceProvider.GetRequiredService(); + if (database.Database.GetPendingMigrations().Any()) + { + database.Database.Migrate(); + } + try { IPollDeviceJob pollDeviceJob = scope.ServiceProvider.GetRequiredService();