namespace HealthchoiceMVC.Migrations { using System; using System.Data.Entity.Migrations; public partial class _20190901 : DbMigration { public override void Up() { CreateTable( "dbo.NetworkAffiliation", c => new { NetworkAffiliationId = c.Int(nullable: false, identity: true), NetworkName = c.String(nullable: false, maxLength: 150), }) .PrimaryKey(t => t.NetworkAffiliationId); CreateTable( "dbo.PracticeLocation", c => new { PracticeLocationId = c.Int(nullable: false, identity: true), PracticeId = c.Int(nullable: false), PracticeLocationName = c.String(nullable: false, maxLength: 100), PracticeManagerName = c.String(nullable: false, maxLength: 100), LocationManagerContactNumber = c.String(nullable: false, maxLength: 12), LocationManagerContactEmail = c.String(nullable: false, maxLength: 150), LocationAddress = c.String(nullable: false, maxLength: 1000), LocationContactNumber = c.String(maxLength: 12), LocationContactEmail = c.String(maxLength: 150), }) .PrimaryKey(t => t.PracticeLocationId) .ForeignKey("dbo.Practice", t => t.PracticeId, cascadeDelete: true) .Index(t => t.PracticeId); CreateTable( "dbo.Practice", c => new { PracticeId = c.Int(nullable: false, identity: true), PracticeName = c.String(nullable: false, maxLength: 150), PracticeTradingName = c.String(maxLength: 150), PracticeNumber = c.String(nullable: false, maxLength: 10), VatNumber = c.String(maxLength: 10), RegistrationNumber = c.String(nullable: false, maxLength: 30), NetworkAffiliationId = c.Int(nullable: false), PracticeManagerName = c.String(nullable: false, maxLength: 100), PracticeManagerContactNumber = c.String(nullable: false, maxLength: 12), PracticeManagerContactEmail = c.String(nullable: false, maxLength: 150), PracticeCorrespondenceAddress = c.String(nullable: false, maxLength: 1000), PracticePrimaryContactNumber = c.String(maxLength: 12), PracticePrimaryContactEmail = c.String(maxLength: 150), }) .PrimaryKey(t => t.PracticeId) .ForeignKey("dbo.NetworkAffiliation", t => t.NetworkAffiliationId, cascadeDelete: true) .Index(t => t.NetworkAffiliationId); } public override void Down() { DropForeignKey("dbo.PracticeLocation", "PracticeId", "dbo.Practice"); DropForeignKey("dbo.Practice", "NetworkAffiliationId", "dbo.NetworkAffiliation"); DropIndex("dbo.Practice", new[] { "NetworkAffiliationId" }); DropIndex("dbo.PracticeLocation", new[] { "PracticeId" }); DropTable("dbo.Practice"); DropTable("dbo.PracticeLocation"); DropTable("dbo.NetworkAffiliation"); } } }