Reputation: 4126
I am about to build a multi tenant web application, where each client (tenant) is in separate databse, but web application is the same across tenants.
Therefor i am looking for a good strategy of how to apply Entity framework migrations for tenants when webapplication get updated.
I cant figure out if its best to create a service which upgrades all the clients at once, or every client get upgraded on the fly when they sign in first time into the web application? Or there might be other simpler solutions?
Upvotes: 0
Views: 78
Reputation: 2263
I have a piece of code that does somethings like this.
In my case it runs as part of our CD process, which triggers a job (Hangfire) that updates all our databases for our multi-tenant scenario.
In our case, this enforces that code updates gets deployed every time along with dbs migrations.
The overhead of running a migration job over already migrated dbs is minimal, so no worries to run it after each deployment.
Upvotes: 1