namespace HealthchoiceMVC.Migrations { using System; using System.Data.Entity.Migrations; public partial class _20190910d : DbMigration { public override void Up() { CreateTable( "dbo.PersonField", c => new { PersonFieldId = c.Int(nullable: false, identity: true), PersonId = c.Int(nullable: false), PersonTypeId = c.Int(nullable: false), FieldType = c.String(nullable: false), FieldValue = c.String(nullable: false), }) .PrimaryKey(t => t.PersonFieldId) .ForeignKey("dbo.Person", t => t.PersonId, cascadeDelete: true) .ForeignKey("dbo.PersonType", t => t.PersonTypeId, cascadeDelete: true) .Index(t => t.PersonId) .Index(t => t.PersonTypeId); } public override void Down() { DropForeignKey("dbo.PersonField", "PersonTypeId", "dbo.PersonType"); DropForeignKey("dbo.PersonField", "PersonId", "dbo.Person"); DropIndex("dbo.PersonField", new[] { "PersonTypeId" }); DropIndex("dbo.PersonField", new[] { "PersonId" }); DropTable("dbo.PersonField"); } } }