Skip to content

System.Data.SQLite.EntityFramework.Migrations - Migrations for SQLite Entity Framework provider

License

Notifications You must be signed in to change notification settings

bubibubi/sqliteef6migrations

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());
        }
    }

About

System.Data.SQLite.EntityFramework.Migrations - Migrations for SQLite Entity Framework provider

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages