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)
- ...
- can not change primary key column
- Download the library (using NuGet)
- Create a migration configuration
- Setup the migration configuration (usually during first context creation)
internal sealed class ContextMigrationConfiguration : DbMigrationsConfiguration<Context>
{
public ContextMigrationConfiguration()
{
AutomaticMigrationsEnabled = true;
AutomaticMigrationDataLossAllowed = true;
}
}
Not Realy Delete Column,Just Rename Column
class Context : DbContext
{
static Context()
{
Database.SetInitializer(new MigrateDatabaseToLatestVersion<Context, ContextMigrationConfiguration>(true));
}
// DbSets
}
class Context : DbContext
{
static Context()
{
Database.SetInitializer(new MigrateDatabaseToLatestVersionExtention<Context, ContextMigrationConfiguration>(true));
}
// DbSets
}
- Drop Column Imp
- Rename Column
- Record Delete Column Info
- Add Additional Migration
- Create Temp Table Base Record Info
- Copy Data To Temp Table
- Drop Original Table
- Rename Temp Table
- Alter Column Imp
- Similar Drop Column
- Alter Column Will Migrate Data Column By Column
- Sqlite AlterTable:Official Recommandition Process
- EntityFramework 6
- EnfityFramework Core
- Sqlite Logo
- Boolean need set default 0/1, not True/False - add column
- System.Data.Sqlite cast error for True/False - GetBoolean