3

Is there a way to prevent Entity Framework Code-First from deleting my database diagrams when it is re-building my database?

anon
  • 4,578
  • 3
  • 35
  • 54

1 Answers1

1

Without using DropCreateDatabaseIfModelChanges to create your database you can use SQL Migrations
http://www.hanselman.com/blog/EntityFrameworkCodeFirstMigrationsAlphaNuGetPackageOfTheWeek10.aspx. It won't drop the database and will generate alter commands (Incremental database development) . So you can keep your diagram and existing data.

Jayantha Lal Sirisena
  • 21,216
  • 11
  • 71
  • 92