Starting to add log user
This commit is contained in:
@@ -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'");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user