0

relating to this msdn sample I've build a application which generates the database from a model. Now I think about the fact that I have a filled database and don't want to drop all tables because of the losing of my data. Is there a possibility to generate a "alter table" version of thequery instead of a "drop table" version?

regards Chris

masterchris_99
  • 2,683
  • 7
  • 34
  • 55

1 Answers1

0

If you've made changes to models and want those changes to be reflected in your database without losing data you should look at using Entity Framework Code First Migrations.

The tutorial in the link provides a good walk-through.


Migration using model first approach in entity framework

Community
  • 1
  • 1
MattSull
  • 5,514
  • 5
  • 46
  • 68
  • I'm using model-first and I think here is the regimentation of the migrations possibility from you link. – masterchris_99 Apr 07 '13 at 08:53
  • Sorry should have looked at your link. See edited answer I've linked to a similar question with an answer from a reputable user. – MattSull Apr 07 '13 at 12:16
  • No MigrationSqlGenerator found for provider 'System.Data.SQLite'. Use the SetSqlGenerator method in the target migrations configuration class to register additional SQL generators. – masterchris_99 Apr 08 '13 at 19:15