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

Folders and files

NameName
Last commit message
Last commit date
Oct 16, 2020
Jul 8, 2020
Oct 16, 2020
Oct 16, 2020
Jul 12, 2017
Oct 16, 2020
Sep 1, 2016

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