bubibubi / sqliteef6migrations

System.Data.SQLite.EntityFramework.Migrations - Migrations for SQLite Entity Framework provider
Microsoft Public License
40 stars 20 forks source link
ef entity framework migrations sqlite

Project Description
Migrations for Entity Framework 6 SQLite provider

Limitations:

How to use it

Example

    class Context : DbContext
    {
        static Context()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<Context, ContextMigrationConfiguration>(true));
        }

        // DbSets
    }

    internal sealed class ContextMigrationConfiguration : DbMigrationsConfiguration<Context>
    {
        public ContextMigrationConfiguration()
        {
            AutomaticMigrationsEnabled = true;
            AutomaticMigrationDataLossAllowed = true;
            SetSqlGenerator("System.Data.SQLite", new SQLiteMigrationSqlGenerator());
        }
    }