From b1f99dc57ad7d5c2dcb0cb8ae65a8618b9528726 Mon Sep 17 00:00:00 2001 From: Kevin Matsubara Date: Mon, 7 Apr 2025 10:22:05 +0200 Subject: [PATCH] Ensure database created on startup. --- EntityFrameworkCore.Console/Program.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EntityFrameworkCore.Console/Program.cs b/EntityFrameworkCore.Console/Program.cs index 5df3873..149b3e8 100644 --- a/EntityFrameworkCore.Console/Program.cs +++ b/EntityFrameworkCore.Console/Program.cs @@ -3,6 +3,8 @@ using EntityFrameworkCore.Domain; using Microsoft.EntityFrameworkCore; 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 teamTwo = await context.Teams.FirstAsync(t => t.Id == 2);