Replace Log.EmployeeName with Log.User, drop from database

This commit is contained in:
2013-01-06 14:33:49 -05:00
parent d5d58c1649
commit 0b4c7914b3
15 changed files with 140 additions and 54 deletions
@@ -0,0 +1,22 @@
namespace MileageTraker.Web.Migrations
{
using System.Data.Entity.Migrations;
public partial class DropLogEmployeeName : DbMigration
{
public override void Up()
{
DropColumn("Log", "EmployeeName");
}
public override void Down()
{
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");
}
}
}