From 8d43dfafeac57505e021c5b1b70754c31a06b648 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 08:27:52 +0000 Subject: [PATCH 1/2] Initial plan From 5fe78059d1011e7b0cbdd07094f58ec50940f776 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 08:35:58 +0000 Subject: [PATCH 2/2] Fix PostgreSQL event_type table missing error by replacing EnsureCreated with Migrate Co-authored-by: leighghunt <349153+leighghunt@users.noreply.github.com> --- timelapse.api/Data/DbInitializer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/timelapse.api/Data/DbInitializer.cs b/timelapse.api/Data/DbInitializer.cs index 6ceb9c2..afd8bae 100644 --- a/timelapse.api/Data/DbInitializer.cs +++ b/timelapse.api/Data/DbInitializer.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using Microsoft.AspNetCore.Identity; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using timelapse.api.Areas.Identity.Data; using timelapse.core.models; @@ -16,7 +17,7 @@ public static class DbInitializer public static void Initialize(AppDbContext context)//, UserManager userManager) { - context.Database.EnsureCreated(); + context.Database.Migrate(); if(!context.Roles.Where(r => r.Name == RoleName_Admin).Any()){ context.Roles.Add(new Microsoft.AspNetCore.Identity.IdentityRole() {Name = RoleName_Admin, NormalizedName = RoleName_Admin.ToUpper()});