public partial class _222 : DbMigration { public override void Up() { //DropForeignKey("dbo.Assets", "AssetBorrow_Id", "dbo.AssetBorrows"); //DropIndex("dbo.Assets", new[] { "AssetBorrow_Id" }); CreateTable( "dbo.AssetBorrowSubs", c => new { Id = c.Guid(nullable: false), AssetCode = c.String(), AssetName = c.String(), AssetNum = c.String(), Brand = c.String(), Model = c.String(), AssetId = c.String(), Created = c.DateTime(nullable: false), AssetBorrow_Id = c.Guid(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.AssetBorrows", t => t.AssetBorrow_Id) .Index(t => t.AssetBorrow_Id); //DropColumn("dbo.Assets", "AssetBorrow_Id"); } public override void Down() { //AddColumn("dbo.Assets", "AssetBorrow_Id", c => c.Guid()); DropForeignKey("dbo.AssetBorrowSubs", "AssetBorrow_Id", "dbo.AssetBorrows"); DropIndex("dbo.AssetBorrowSubs", new[] { "AssetBorrow_Id" }); DropTable("dbo.AssetBorrowSubs"); // CreateIndex("dbo.Assets", "AssetBorrow_Id"); // AddForeignKey("dbo.Assets", "AssetBorrow_Id", "dbo.AssetBorrows", "Id"); } }