Page 1 of 1

update model (EF4) from database

Posted: Wed 30 Jun 2010 20:30
by HDumas
Hello,

Using VS2010, EF4, MVC2.
We are using iterations for developping a new application. With each iteration, not only is the view part of the application updated, but the model part as well; which means that tables and views are added or modified as the application becomes bigger.
Can you tell me if there is any way with VS2010 to update my EF model (edml) with the modifications that were made to the Oracle DB...
Or do I REALLY have to create from database all over again.

Thank you.

Posted: Thu 01 Jul 2010 09:43
by AndreyR
We are working on the model updating functionality.
At the moment I recommend you to use the drag&drop functionality of Database Explorer, just delete the modified entity from the Store part of the model (using Model Explorer) and add it again (using Database Explorer).

Posted: Fri 02 Jul 2010 13:05
by HDumas
Thank you very much... I had forgotten about the DataBase Explorer...
It will certainly work for now while we wait for the new feature.

Posted: Tue 06 Jul 2010 09:44
by fni
I'm also eager to see an update function. Having to delete and re-add tables to update them is tiresome and risky (don't forget to set those storage patterns every time!).

Posted: Tue 06 Jul 2010 12:20
by AndreyR
We are working on this feature. Feel free to participate in our roadmap corrections here.

Posted: Tue 13 Jul 2010 08:54
by bhav27
AndreyR wrote:We are working on the model updating functionality.
At the moment I recommend you to use the drag&drop functionality of Database Explorer, just delete the modified entity from the Store part of the model (using Model Explorer) and add it again (using Database Explorer).
Your solution does not seems to work for us. I've modified a table in the oracle database and renamed one of its column. Then I refreshed Database Explorer which then shows me the table with same columns as database.

However, when I drag and drop the table in the model the properties of the table created still have old field name in the database table. Can you please advice why is my model not being updated?

I've tried to restart VS2008 and also PC but still facing same problem. Is there anyway to update model manual i.e. the XML generated?

Posted: Tue 13 Jul 2010 09:15
by AndreyR
Please make sure that you have deleted the table from the Model.Store (go to Model Explorer). In the other case there should be the behaviour you describe.

Posted: Tue 13 Jul 2010 10:37
by bhav27
AndreyR wrote:Please make sure that you have deleted the table from the Model.Store (go to Model Explorer). In the other case there should be the behaviour you describe.
That worked fine. Thanks.