Attempting to fix code first migrations not running against a fresh db #40

Merged
cjtibule merged 1 commits from api/features/CodeFirstMigrationsNotWorking into api/develop 2024-04-10 21:43:48 -05:00
2 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,8 @@ steps:
context: ./API context: ./API
dockerfile: ./API/YABA.API/Dockerfile dockerfile: ./API/YABA.API/Dockerfile
tags_file: tags.txt tags_file: tags.txt
platforms:
- linux/amd64
username: username:
from_secret: gitea_yaba_registry_username from_secret: gitea_yaba_registry_username
password: password:

View File

@ -97,7 +97,7 @@ var app = builder.Build();
// Run database migrations // Run database migrations
using (var scope = app.Services.CreateScope()) using (var scope = app.Services.CreateScope())
{ {
var yabaDbContext = scope.ServiceProvider.GetRequiredService<YABAReadWriteContext>(); var yabaDbContext = scope.ServiceProvider.GetRequiredService<YABABaseContext>();
yabaDbContext.Database.Migrate(); yabaDbContext.Database.Migrate();
} }