Let say I have a random code first migration class defined :
public partial class t2 : DbMigration
{
public override void Up()
{
RenameTable(name: "dbo.EntityC", newName: "EntityCs");
DropTable("dbo.EntityA");
DropTable("dbo.EntityB");
}
public override void Down()
{
CreateTable(
"dbo.EntityB",
c => new
{
Id = c.Int(nullable: false, identity: true),
StringOtherProperty = c.String(),
})
.PrimaryKey(t => t.Id);
CreateTable(
"dbo.EntityA",
c => new
{
Id = c.Int(nullable: false, identity: true),
StringProperty = c.String(),
})
.PrimaryKey(t => t.Id);
RenameTable(name: "dbo.EntityCs", newName: "EntityC");
}
}
How can I execute it, regardless of the current data model. Can I, by code or powershell, force the execution of this migration ?