namespace MileageTraker.Web.Migrations
{
    using System.Data.Entity.Migrations;
    
    public partial class DropLogEmployeeName : DbMigration
    {
        public override void Up()
        {
			CreateIndex("User", "FullName", unique: true);
			DropIndex("User", "IX_Email");
            DropColumn("Log", "EmployeeName");
        }
        
        public override void Down()
        {
			DropIndex("User", "IX_FullName");
			CreateIndex("User", "Email", unique: true);
            AddColumn("Log", "EmployeeName", c => c.String(nullable: false));
			Sql(@"UPDATE [Log]
				SET [Log].EmployeeName = [User].FullName
				FROM [Log]
					INNER JOIN [User] ON 
						[User].UserId = [Log].User_UserId");
        }
    }
}
