Answered by:
what is migration and when to use it

Question
-
Hi ,
Im actually creating my first EF using code 1st approach application.
i wanted to know what is migration and when to use it ?
Thank You , Shan Ali Khan
Sunday, January 5, 2014 7:34 PM
Answers
-
-
Hello Shan,
>> What is migration?
Code First Migrations allow for database changes to be implemented all through code. Through the use of Package Manager Console (PMC), commands can be used to scaffold database changes. And there are two ways to use it: manual migrations and automatic migrations.
For how to use code first with manual migrations, please refer to link below:
http://msdn.microsoft.com/en-us/data/jj591621.aspx#model
For how to use code first with automatic migrations, please refer to link below:
http://msdn.microsoft.com/en-us/data/jj554735.aspx
>>When to use it?
When we did some changes with the entities classes (for example, adding a property) and the navigation between them and we did not want to delete the existed database and re-created it, then we could use the migrations.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Marked as answer by Fred Bao Tuesday, January 14, 2014 8:30 AM
Monday, January 6, 2014 1:44 AM
All replies
-
-
Hello Shan,
>> What is migration?
Code First Migrations allow for database changes to be implemented all through code. Through the use of Package Manager Console (PMC), commands can be used to scaffold database changes. And there are two ways to use it: manual migrations and automatic migrations.
For how to use code first with manual migrations, please refer to link below:
http://msdn.microsoft.com/en-us/data/jj591621.aspx#model
For how to use code first with automatic migrations, please refer to link below:
http://msdn.microsoft.com/en-us/data/jj554735.aspx
>>When to use it?
When we did some changes with the entities classes (for example, adding a property) and the navigation between them and we did not want to delete the existed database and re-created it, then we could use the migrations.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Marked as answer by Fred Bao Tuesday, January 14, 2014 8:30 AM
Monday, January 6, 2014 1:44 AM