Entity Developer migrations

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Zero-G.
Posts: 391
Joined: Sat 09 Dec 2006 12:20

Entity Developer migrations

Post by Zero-G. » Mon 23 Nov 2015 13:56

Hey
I wanted to know, what the best way is to use migrations with Code first?!?
When I do have an existing EDML file and there I add a new class through the designer.
How will the Migration be handled? - Or do I have to do this by Hand? (Doing it twice, once within the designer and once writing the migrations up and down(s)?)
Hope you can give me some informations or maybe you could provide me a sample Project!?

THX

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Entity Developer migrations

Post by Shalex » Tue 24 Nov 2015 10:48

There are two alternative ways for synchronizing your model with the database:
1) update your database in Entity Developer via right click the designer surface > Update Database From Model
2) use Code First Migrations

If this doesn't help, please clarify the question and specify the way (1 or 2) you are using.

Zero-G.
Posts: 391
Joined: Sat 09 Dec 2006 12:20

Re: Entity Developer migrations

Post by Zero-G. » Tue 24 Nov 2015 11:47

Hey
Thanks for your answer.
Here is, my way of work (and probably a Suggestion for an upcoming release)
I started with Code first aproach. But by using your graphical Environment EntityDeveloper.
As you said, within the tool I do have the Option to update the database.
But when I roll my program out to my customers, I don't have this Option. - So I have to update the database by Code.
When I do the Code First Aproach provided by Microsoft, then it works fine, but with the end result, that I can't see the changes within Entity Developer. - So I have to do the changes twice.
1) Within the Entity Framework
2) Writing the Code first changes by Hand.
This isn't a clean way.
As Workaround I could Change the tables within Entity Developer and let me create a script of changes and run this script through my Clients database on update.
But then, the strong typing aproach from Code first isn't given anymore.

Hope you understand what I try to do.
As Suggestion for an upcoming Version it would be good, to have the possibility to automatic generate a Code first Migration peace of Code.

THX

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Entity Developer migrations

Post by Shalex » Wed 25 Nov 2015 14:51

Zero-G. wrote:As Suggestion for an upcoming Version it would be good, to have the possibility to automatic generate a Code first Migration peace of Code.
Thank you for the suggestion.

Post Reply