Skip to content

Commit

Permalink
test migration code
Browse files Browse the repository at this point in the history
  • Loading branch information
area363 committed Jul 4, 2024
1 parent c2a797f commit 7427f2e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions NineChronicles.DataProvider.Executable/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ public static async Task Main(string[] args)
{
await CoconaLiteApp.CreateHostBuilder()
.RunAsync<Program>(args);
var host = CreateHostBuilder(args).Build();
using (var scope = host.Services.CreateScope())
{
var db = ServiceProviderServiceExtensions
.GetRequiredService<NineChroniclesContext>(scope.ServiceProvider);
Console.WriteLine("Migrate db.");
db.Database.Migrate();
}

host.Run();
}

// EF Core uses this method at design time to access the DbContext
Expand Down

0 comments on commit 7427f2e

Please sign in to comment.