This could be an Entity Framework Issue so I will cross post on Stack Overflow.
I want to implement a change log as advised in https://www.devexpress.com/Support/Center/Question/Details/T474899">T474899
I am using the security system generated by the new solution wizard
I have defined some business objects to store the change log information.
One of these objects stores a link to the user
public virtual User User { get; set; }
On generating the code migration I am surprised to see the Up() method add the following
C#RenameTable(name: "dbo.UserRoles", newName: "RoleUsers");
DropPrimaryKey("dbo.RoleUsers");
AddPrimaryKey("dbo.RoleUsers", new[] { "Role_ID", "User_ID" });
http://stackoverflow.com/questions/42425830/code-migration-unexpectedly-tries-to-rename-table