2

In mySql Workbench there's a possibility to "sync" the model with the DB and vice versa. Is there a function like this in EF? I've added som entities and I'd like it to get reflected in the DB. Do I really have to regenerate the entire DB and loose data?

Thanks

1
  • That is possible with 3rd party tools. My company makes an add-in that gives you two-way incremental comparison and sync between DB, SSDL, and CSDL. See huagati.blogspot.com/2010/07/… for an intro screencast. You can download the add-in from huagati.com/dbmltools and get a trial license from the same site if you want to take it for at test spin. Commented Oct 17, 2010 at 15:02

2 Answers 2

2

Sadly there is no easy way AFAIK to do this today.

One way to handle this is to generate the DDL and then cut and paste the new sections into SQL Server Management Studio and run them there. If you want to maintain scripts for each release of the database you'll need to take an approach like this too.

See also: Database migrations for Entity Framework 4

PS The EF Power Pack: http://msdn.microsoft.com/en-us/data/ff830362.aspx may help. It says "The second useful feature related to model-first the ability to update an existing database and synchronize the model with it. This allows you to make changes to the model that can be deployed to the database without data loss."

Sign up to request clarification or add additional context in comments.

4 Comments

Not the solution I was hoping for but you provided a reasonable work around. Thanks!
Thank you. It seems as a good way of solving my problem. If I use it I'll comment on how I found it.
@Phil so how did you find it
Never used it. Stopped wanting to generate db from models.. too unpredictable
-1

if you are using the VS2010 then in Select your edmx designer ( designer showing tables) and right click it will show the update model option.

1 Comment

I asked for the other way around. A way to update DB. Thanks anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.