Click here to Skip to main content
16,017,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using entity framework DB first approach and wants to know how can I manage migrations in DB first approach. We're doing changes in database schema manually. Is there any way by which Entity Framework can apply the changes accordingly to the project.
Posted
Updated 4-Nov-13 22:16pm
v2

Just open your Model(Ado.net model) and right click your design then press : Update model from DataBase. if it dosent work, delete all your entities from the model and try again.
 
Share this answer
 
I guess I got confused between the code first with existing database and database first with model. What I understood is, after searching in different forums, Migrations are allowed only in code first approach. Code first assumes that you will never make any changes manually to the database. All the changes to the database will go through the code first migrations. This is true for code first with an existing database as well. If you are working with code first with existing database then it assumes that after connecting the database for first time all the changes to the database will go through the code first migration instead of manually. When you are using Model instead of code first approach then any manual changes to the database can be migrated to the model by Update model from Database option. Which can be accessed by right clicking on the model.
I hope my understanding is correct but any modifications or corrections are welcome.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900