AI did some stuff
This commit is contained in:
15
Lutra/Lutra.Infrastructure.Migrator/Program.cs
Normal file
15
Lutra/Lutra.Infrastructure.Migrator/Program.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Lutra.Infrastructure.Sql;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
var builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
builder.Services.AddDbContext<LutraDbContext>(options =>
|
||||
options.UseNpgsql(builder.Configuration.GetConnectionString("LutraDb")));
|
||||
|
||||
using var host = builder.Build();
|
||||
using var scope = host.Services.CreateScope();
|
||||
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<LutraDbContext>();
|
||||
await dbContext.Database.MigrateAsync();
|
||||
Reference in New Issue
Block a user