Base solution for your next web application
Open Closed

Implementing multi tenancy - DB Per Tenant #2274


User avatar
0
omkarchoudhari created

Single Web Deployment - Multiple Database

We want to implement Multitenant applicaion with seperated database for each tenant The problem is We need to create and maintain a seperated database for each tenant, this includes database migrations. We are aiming for auto creation of tenant DB's with a single user. So far we have created separate TenantDbcontext and added separate migrations , and migrations are added successfully. But after adding migration we are unable to update Db . The error is in the attached image. The migration is adding host tables in migration.

Could we have a simple step by step instruction list that would enable us to approach this implementation ?


2 Answer(s)
  • User Avatar
    0
    JeffMH created

    I don't think this is a problem with the framework.

    <a class="postlink" href="http://stackoverflow.com/questions/17127351/introducing-foreign-key-constraint-may-cause-cycles-or-multiple-cascade-paths">http://stackoverflow.com/questions/1712 ... cade-paths</a>

    We have seen this using the default cascade option in EF a ton. That article explains the error some.

    Hope that helps.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    As @JeffMH says, according to error message, your problem seems something related to EF. Can you share your JourneyLink entity ?

    If you don't want host entities on tenant databases, you need to derive your DbContext from AbpZeroTenantDbContext.