Last post Nov 12, 2015 05:00 AM by mds2907
Nov 12, 2015 02:44 AM|mds2907|LINK
It is very important for me to understand the realtime impact of using EF code forst approach for the development.
I am working on an web application, which in future will be adding more modules and functionalities as the application grows larger. For this I am planning to use
MVC4 and EF codefirst approach.
The database will be designed by me, but there will be multiple developers who will be working on the same DB.
Its been some time that I have started to learn MVC4 and EF basics. I am trying to work around with few examples using Code first approach.
I have learnt creating model classes, DB context , and also updating the new database changes using
Code first migrations and it feels good to implement these new features and to see that it works perfect !!!.
But what keeps me thinking and hold me back from going further is
"How far it is appropriate to use "EF code first with migrations" to use for in our application where we have many developers who will be working on the same database for different modules. Since every one will be using code first , there
are chances of clash. For example, in a scenario suppose I am working on module A and I try to update my database column by changing the existing column datatype to a new one during development phase and I use Migrations and update the database column new
datatype. But the same column will be used by other developers with the old datatype. Therefore there will a clash in the column datatype and hence it might result in error in other modules during executions. How this scenario is handled in real world development?
Please advice me. I look forward to hearing from you.
Your help is appreciated
Nov 12, 2015 03:15 AM|Mikesdotnetting|LINK
suppose I am working on module A and I try to update my database column by changing the existing column datatype to a new one during development phase and I use Migrations and update the database column new datatype. But the same column will be used by other
developers with the old datatype. Therefore there will a clash
You would have the same issues if you manually altered the database schema. Migrations doesn't introduce any new issues in this regard. Here's some advice on working with migrations in a team environment: https://msdn.microsoft.com/en-us/data/dn481501.aspx
Nov 12, 2015 05:00 AM|mds2907|LINK
Thanks of the reply.
I have started reading the article which you have provided a link to. before that I would like to add as below.
In manual database changes, Since I will the in-charge of database , therefore any changes have to be informed to me to be updated. But In case of EF, the developers can make changes to database by updating their model, adding migrations and running update-database
command to make their changes. This is where I am more worried about.