Hi.
I have multiple sets of migrations as per #21443, and would like to run auto migration for the local and development environments.
DatabaseFacade.Migrate doesn't accept any arguments, so it will try to run all migrations in the project. Running
dotnet ef database update --namespace=MyApp.MobileAppService.Migrations.Development --context ContextName
allows for the --namespace argument, which will pick the correct "set" of migrations.
I'd like to do the same programmatically, but DatabaseFacade.Migrate() doesn't support it. So please add an overload,
DatabaseFacade.Migrate(string namespace)
so it reaches parity with the command line migration capability.
Here is an example of what I'd like to do:
if (this.IsLocalOrDevelopmentEnvironment())
{
var migrationNamespace = $"MyApp.MobileAppService.Migrations.{this.environment.EnvironmentName}";
myContext.Database.Migrate(migrationNamespace);
}
which would be analogous to running:
dotnet ef database update --namespace=MyApp.MobileAppService.Migrations.$ENVIRONMENT --context MyContext
Hi.
I have multiple sets of migrations as per #21443, and would like to run auto migration for the local and development environments.
DatabaseFacade.Migrate doesn't accept any arguments, so it will try to run all migrations in the project. Running
dotnet ef database update --namespace=MyApp.MobileAppService.Migrations.Development --context ContextNameallows for the --namespace argument, which will pick the correct "set" of migrations.
I'd like to do the same programmatically, but DatabaseFacade.Migrate() doesn't support it. So please add an overload,
so it reaches parity with the command line migration capability.
Here is an example of what I'd like to do:
which would be analogous to running:
dotnet ef database update --namespace=MyApp.MobileAppService.Migrations.$ENVIRONMENT --context MyContext