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.

38 lines
1.5 KiB

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