Ensure database created on startup.

This commit is contained in:
Kevin Matsubara 2025-04-07 10:22:05 +02:00
parent e863015075
commit b1f99dc57a

View File

@ -3,6 +3,8 @@ using EntityFrameworkCore.Domain;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using var context = new DeadBallZoneLeagueDbContext(); using var context = new DeadBallZoneLeagueDbContext();
// context.Database.Migrate(); // Can be used to automatically migrate on run.
context.Database.EnsureCreated();
// var teamOne = await context.Teams.FirstAsync(t => t.Id == 1); // var teamOne = await context.Teams.FirstAsync(t => t.Id == 1);
// var teamTwo = await context.Teams.FirstAsync(t => t.Id == 2); // var teamTwo = await context.Teams.FirstAsync(t => t.Id == 2);