In the migration, You should add your index creation to the up() method and a drop statement to the Down() method to enable downgrading the database schema
namespace TestLib.Migrations
{
using System.Data.Entity.Migrations;
public partial class UserTable : DbMigration
{
public override void Up()
{
CreateIndex("User", new string[] { "UserId", "UserName" },
true, "IX_User_UserId");
}
public override void Down()
{
DropIndex("User", "IX_User_UserId");
}
}
}
Then you should apply the update through the Package Manager Console