Files
MileageTraker/Web/Migrations/201301031939259_AddLogUser.cs
T
2013-01-04 19:47:48 -05:00

35 lines
843 B
C#

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'");
}
}
}