From 729354297f0179d727dd55de875954c8128ee1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Michel?= Date: Mon, 25 Oct 2021 00:09:36 +0200 Subject: [PATCH] Make TODO: Only run this if using a real database (#569) use IsSqlServer extension method on catalogContext.Database (DatabaseFacade) --- src/Infrastructure/Data/CatalogContextSeed.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/Data/CatalogContextSeed.cs b/src/Infrastructure/Data/CatalogContextSeed.cs index 7f0722a..c2fb2f5 100644 --- a/src/Infrastructure/Data/CatalogContextSeed.cs +++ b/src/Infrastructure/Data/CatalogContextSeed.cs @@ -15,8 +15,11 @@ namespace Microsoft.eShopWeb.Infrastructure.Data int retryForAvailability = retry.Value; try { - // TODO: Only run this if using a real database - // catalogContext.Database.Migrate(); + if (catalogContext.Database.IsSqlServer()) + { + catalogContext.Database.Migrate(); + } + if (!await catalogContext.CatalogBrands.AnyAsync()) { await catalogContext.CatalogBrands.AddRangeAsync(