问题
I am using the ASP.NET ZERO framework with ASP.NET Core and Angular for my current project.
I am also using the 'MultiTenancy - MultiDatabase' feature of ASP.Net ZERO.
In application I have added a 'Tenant1-Database' connection string in create new Tenant.
Now i have two databases:
- Host-Database
- Tenant1-Database
When I create a new Tenant, 'Tenant1-Database' is automatically update as per previous migration files.
But when I update the model with a new property and try to migrate the database using code-first approach, I see that 'Host-Database' is the only db migrated with the new properties and Tenant1-Database is not migrated.
My question is: How can I migrate into both databases using a single migration file?
回答1:
Yeah.. I Got the Solution
In the ASP.Net Zero, whole sample template have project with Projectname.Migrator
ASP.Net Zero already provides the Host database and all Tenant Databases migrations by console application
Just need to Create a migration file and execute project with Projectname.Migrator
来源:https://stackoverflow.com/questions/51319134/how-do-i-migrate-tenant-databases-and-host-database-in-asp-net-zero-boilerplat