From 414f66dbd0c16b96e0555d95973bfc3255d3e3e5 Mon Sep 17 00:00:00 2001 From: Vitalick Kovalenko Date: Sat, 23 Dec 2023 02:29:05 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CyberBoom/DbContext/User.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CyberBoom/DbContext/User.cs b/CyberBoom/DbContext/User.cs index 69dc2d6..f13d0fe 100644 --- a/CyberBoom/DbContext/User.cs +++ b/CyberBoom/DbContext/User.cs @@ -104,7 +104,13 @@ public class ApplicationContext : IdentityDbContext public ApplicationContext(DbContextOptions options) : base(options) { - Database.Migrate(); + try{ + Database.Migrate(); + } + catch + { + Database.EnsureCreated(); + } } protected override void OnModelCreating(ModelBuilder builder)