AI did some stuff
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Lutra.Infrastructure\Lutra.Infrastructure.Sql.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
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