4

We are developing a scholar system witch is a multi-tenant application using entity framework 6 MVC and CODE FIRST MIGRATIONS and that's the problem, our multi tenant uses schemas (Sql server 2012+) to separate the data but all the migrations are being generated with DBO schema. For the development there is no problem on doing that BUT... when going on production we need to run these migrations on all our client schemas. Is there a beautiful way to do that? What do you guys suggest us to do? Well my friends, thanks in advance :)

gabriel.santos
  • 160
  • 1
  • 10

1 Answers1

3

Here is your answer:

Read the following posts:

  1. entity-framework-and-multiple-schemas
  2. romiller.com/2011/05/23/ef-4-1-multi-tenant-with-code-first/

I am pretty sure, your problem will be solved by the provided links. Thanks

Community
  • 1
  • 1
vivek
  • 1,595
  • 2
  • 18
  • 35
  • Don't use EF Migrations for updating tenants.. it can get really complicated and hairy if something breaks and the error messages are useless. Better use a SQL Project and use SQL Packages. Much better visibility and deployment strategies can be used. – Piotr Kula Mar 21 '19 at 11:18
  • Could you expand on this? I'm in the same situation and would like to hear a bit more about how you do this. – Notbad Jun 30 '20 at 10:58