How to handle multiple schemas #1509
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The only way to handle this is to run the migrator with different configurations. It contains a convention set that can be customized. Here is what needs to be done step by step:
Example: // Other configuration yadda-yadda ignored
services.AddScoped<IConventionSet>(_ => new DefaultConventionSet("your-custom-schema"));
using var serviceProvider = services.BuildServiceProvider();
using var scope = serviceProvider.CreateScope();
var runner = scope.ServiceProvider.GetRequiredService<IMigrationRunner>();
runner.MigrateUp(); The important part here is to provider your own custom convention set. |
Beta Was this translation helpful? Give feedback.
The only way to handle this is to run the migrator with different configurations. It contains a convention set that can be customized.
Here is what needs to be done step by step:
IConventionSet
serviceIMigrationRunner
MigrateUp
on the runnerExample: