Replace Log.EmployeeName with Log.User, drop from database
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user