How Do I Migrate Tenant Databases and Host Database in Asp.NET ZERO / Boilerplate?

本秂侑毒 提交于 2020-01-15 03:51:10

问题


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:

  1. Host-Database
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!