You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.4 KiB

11 years ago
  1. namespace Sevomin.Models.Migrations
  2. {
  3. using System.Data.Entity.Migrations;
  4. public partial class JobParameter : DbMigration
  5. {
  6. public override void Up()
  7. {
  8. CreateTable(
  9. "dbo.JobParameters",
  10. c => new
  11. {
  12. Id = c.Long(nullable: false, identity: true),
  13. ParameterId = c.Long(nullable: false),
  14. JobId = c.Long(nullable: false),
  15. StringValue = c.String(),
  16. NumericValue = c.Decimal(precision: 18, scale: 2),
  17. Moscow = c.Byte(nullable: false),
  18. })
  19. .PrimaryKey(t => t.Id)
  20. .ForeignKey("dbo.Jobs", t => t.JobId, cascadeDelete: true)
  21. .ForeignKey("dbo.Parameters", t => t.ParameterId, cascadeDelete: true)
  22. .Index(t => new { t.ParameterId, t.JobId }, unique: true, name: "IX_JobParameterUniqueIndex")
  23. .Index(t => t.JobId);
  24. }
  25. public override void Down()
  26. {
  27. DropForeignKey("dbo.JobParameters", "ParameterId", "dbo.Parameters");
  28. DropForeignKey("dbo.JobParameters", "JobId", "dbo.Jobs");
  29. DropIndex("dbo.JobParameters", new[] { "JobId" });
  30. DropIndex("dbo.JobParameters", "IX_JobParameterUniqueIndex");
  31. DropTable("dbo.JobParameters");
  32. }
  33. }
  34. }