相关文章推荐
神勇威武的感冒药  ·  GitHub - ...·  2 月前    · 
烦恼的毛豆  ·  Ruby Pui Yi LEUNG – ...·  5 月前    · 
想出国的小虾米  ·  Question: How to use ...·  1 年前    · 
冷静的大熊猫  ·  HTML5 ...·  1 年前    · 

Repository files navigation

Project Description
Migrations for Entity Framework 6 SQLite provider

Limitations:

  • Relationships are not enforced with constraints
  • There can be only one identity column per table and will be created as integer and primary key (other primary keys will be ignored)
  • It supports only SQLite database file and does not work with in SQLite memory database.
  • How to use it

  • Download the library (using NuGet)
  • Create a migration configuration
  • Setup the migration configuration (usually during first context creation)
  • 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());
            System.Data.SQLite.EntityFramework.Migrations - Migrations for SQLite Entity Framework provider
        

    Topics

    framework migrations sqlite entity