Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Handling Migrations for MultiTenant Application #2903


User avatar
0
omkarchoudhari created

How do we automate the process of adding migrations and updating tenant databases automatically for a multi-tenant application ? Our product is single web app and database per tenant. Right now we are manually updating each tenant database individually.

Please inform how we can maintain and automate the code first migrations and update database for all tenants at the same time whenever a new migration is added.

Thanks


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    For adding migrations, you need to add migrations using Visual Studio on development time. But, for updating all tenant databases and host database, you can use Migrator tool included in your downloaded solution.

    You need to run this tool in a machine which has access to host db and all tenant DBs.

    Thanks.

  • User Avatar
    0
    omkarchoudhari created

    I Understand. However , our web application is hosted on azure . Shared space. As such we do not have access to the server where these DB's are located . That is the reason we need to automate this process through code.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If your local machine cannot access DBs on azure, I think of two ways.

    1. You can place migration code into your web app's startup, the code exists in Migrator tool for now. And run it in every app start.

    2. Or you can create a dummy application which contains Migration code exists in Migrator tool and deploy it to azure. In this way, you can update all of your DBs when you want.

    What do you think ?

    Thanks.