msallin / SQLiteCodeFirst

Creates a SQLite Database based on a EdmModel by using Entity Framework CodeFirst.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update table with database sqlite exists

tuanth89 opened this issue · comments

Hi, firstly. Thank for SqliteCodeFirst project!
How to update table change (ex: add field) with database exists ?
I just found 3 class:

  • SqliteCreateDatabaseIfNotExists.cs
  • SqliteDropCreateDatabaseAlways.cs
  • SqliteDropCreateDatabaseWhenModelChanges.cs

Which way UpdateDatabaseWhenModelChange ?
I don't want drop db because relate to important data.

Thanks

Hi

Migrations are not supported (#4).
Its easy to create a migration like feature by yourself. This is what I did once for a project.
You can create your own initializer and use this library to generate the database if it not exists.