namespace Sevomin.Models.Migrations { using System.Data.Entity.Migrations; public partial class JobParameter : DbMigration { public override void Up() { CreateTable( "dbo.JobParameters", c => new { Id = c.Long(nullable: false, identity: true), ParameterId = c.Long(nullable: false), JobId = c.Long(nullable: false), StringValue = c.String(), NumericValue = c.Decimal(precision: 18, scale: 2), Moscow = c.Byte(nullable: false), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Jobs", t => t.JobId, cascadeDelete: true) .ForeignKey("dbo.Parameters", t => t.ParameterId, cascadeDelete: true) .Index(t => new { t.ParameterId, t.JobId }, unique: true, name: "IX_JobParameterUniqueIndex") .Index(t => t.JobId); } public override void Down() { DropForeignKey("dbo.JobParameters", "ParameterId", "dbo.Parameters"); DropForeignKey("dbo.JobParameters", "JobId", "dbo.Jobs"); DropIndex("dbo.JobParameters", new[] { "JobId" }); DropIndex("dbo.JobParameters", "IX_JobParameterUniqueIndex"); DropTable("dbo.JobParameters"); } } }