Surprisingly, I can't find anyone with this particular scenario, so listen. I am developing a MVC / EF web application in SAAS style. I want to offer each client their own subdomain name and an isolated database, the domain name will determine the name / connection string for one EF application context. Therefore, when each client subscribes, I will create a new database and redirect them to my subdomain for login.
However, when I switch the connection name at runtime, the first code migrations fail and do not provide a new database to the latest version. I assume this is due to the fact that EF will only trigger migration for each type of context throughout the life of the application. Any suggestions? Can I somehow manually migrate when the application starts for all registered subdomains / databases?
source
share