I need to ensure my application itself is able to upgrade his database model (apply migrations)
In the ABP architecture, where should I make the call to Migrate?
context.Database.Migrate();
As this is a call to a infraestructure logic (Entity framework Core) it should be kept out from domain services and application services.
Thanks in advance
Hi you can execute database migrations in PostInitialize method in EntityFrameworkCoreModule.
public class MyApplicationEntityFrameworkCoreModule : AbpModule
{
public override void PostInitialize()
{
if (!SkipDbSeed)
{
SeedHelper.SeedHostDb(IocManager);
}
// --> You can execute migrations here <--
}
}