More AI changes
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Lutra.Domain.Entities;
|
||||
using Lutra.Infrastructure.Sql;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
@@ -14,3 +15,26 @@ using var scope = host.Services.CreateScope();
|
||||
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<LutraDbContext>();
|
||||
await dbContext.Database.MigrateAsync();
|
||||
|
||||
if (!await dbContext.Supermarkten.AnyAsync())
|
||||
{
|
||||
var createdAt = DateTime.UtcNow;
|
||||
dbContext.Supermarkten.AddRange(
|
||||
CreateSupermarkt("Albert Heijn", createdAt),
|
||||
CreateSupermarkt("Jumbo", createdAt),
|
||||
CreateSupermarkt("Poiesz", createdAt),
|
||||
CreateSupermarkt("Lidl", createdAt));
|
||||
|
||||
await dbContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
static Supermarkt CreateSupermarkt(string naam, DateTime createdAt)
|
||||
{
|
||||
return new Supermarkt
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Naam = naam,
|
||||
CreatedAt = createdAt,
|
||||
ModifiedAt = createdAt
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user