Starting to add log user

This commit is contained in:
2013-01-04 19:47:48 -05:00
parent 5ae38a80ee
commit 09a21d2b2d
8 changed files with 73 additions and 6 deletions
@@ -0,0 +1,34 @@
namespace MileageTraker.Web.Migrations
{
using System.Data.Entity.Migrations;
public partial class AddLogUser : DbMigration
{
public override void Up()
{
Sql(@"INSERT INTO [Role]
([RoleId]
,[RoleName]
,[Description])
VALUES
('C070ADF5-CCA3-42B0-92E4-9E38472940DF'
,'Driver'
,'Driver')");
AddColumn("Log", "User_UserId", c => c.Guid());
AddForeignKey("Log", "User_UserId", "User", "UserId");
CreateIndex("Log", "User_UserId");
}
public override void Down()
{
DropIndex("Log", new[] { "User_UserId" });
DropForeignKey("Log", "User_UserId", "User");
DropColumn("Log", "User_UserId");
Sql(@"DELETE FROM ROLE WHERE RoleName = 'Driver'");
}
}
}