Entity Framework 4.3 migrations on existing “Shared” database?

I don't think it's possible to have multiple EF models in the same database. EF shouldn't try to touch tables that are nothing to do with its model, but if you wanted to add another EF app to the same database you'd run into trouble because they'd try to share the same MetaData tables.

It seems to WORK. I started with an existing database. Created an mvc app (app1) with couple of models.

I then created a schema for this app in database. I specified schema for the models as per your comment. Then I used the power of code based migration script to update the database.

Migration script created 2 tables under the new schema without corrupting existing stuff. I noticed EF created __MigrationHistory table with a row with change info. Then I created another app, a new schema and repeated the migration process with a little tweak in migration script.

The script had code to re-create 2 tables of app1. I deleted that code from script. EF then successfully created new tables under new schema and also created new row in __MigrationHistory table with info about new changes.

All existing stuff remain unchanged including data.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions