mardi 15 septembre 2015

EntityFramework 7 - CodeFirst - SQLite - Manage DB using ApplyMigrations at runtime

I am well on my way to utilizing EF7 CodeFirst with SQLite...but really want to employ DB Migrations at runtime. This is a desktop application (Click-once deployment) meant to sync with a main database when connection is available, and provide offline data when no connection is present.

I have pulled down the nuget pre-release versions and all is working, except I cannot find any documentation of how to apply the migrations at runtime. I can successfully Add-Migrations and manually Apply-Migrations...but need a way to programatically Apply-Migrations at runtime.

I've also browsed the EF7 open-source project, but could not get anywhere there.

Versions I'm using: Latest Pre-release as of 9/15/2015 EntityFramework.Sqlite v7.0.0-beta7 EntityFramework.Relational v7.0.0-beta7 EntityFramework.Commands v7.0.0-beta7 ...et al...you get the picture.

I am asking for help to apply runtime migrations...or what is the documented/recommended path for programatically maintaining a local/embedded db using EF7 CodeFirst SQLite?

UPDATE: I went back to EF6 with SQLite but then found out that there is not SQLMigrationGenerator for SQLite.

Aucun commentaire:

Enregistrer un commentaire