4

I'm developing an application with EF4.0. Between the releases the database schema can change (e.g. column added, table added...).

Is there a way to commit these changes to the customers database when they run the new release? I'm thinking of an function similar to CreateDatabase().

6
  • I'm almost sure that there is nothing like this out of the box. Creating a function to migrate DB schema with no data lost will be very hard task if ever possible. For example, context always has the latest version of storage schema, think about that. Commented Jun 30, 2010 at 12:46
  • 1
    Possible duplicate of Entity Framework 4 - Update database schema from model. Without wiping the table data. I believe this question answers yours. Commented Jun 30, 2010 at 13:16
  • No, the question you linked seems to handle the database update from the EF designer. But i'm looking for a way to alter the database when the customer runs an update without running a "handmade" sql script. Commented Jun 30, 2010 at 13:40
  • You don't need a "handmade" script. VS will make the script for you. You just need to run it. Commented Jun 30, 2010 at 13:42
  • 2
    Yes, he does. And the VS 2010 schema migration (formerly "data dude") knows how to do this. Commented Jun 30, 2010 at 20:57

1 Answer 1

1

Your install procedure must do two things:

  • Run a script to update the database
  • Install the new program files

To generate the database script use the tools in visual studio, see http://www.sqlskills.com/BLOGS/KIMBERLY/post/Data-Dude-moving-into-lower-priced-VS-Editions-in-VS-2010-excellent!.aspx

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

Comments

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.