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.

46 lines
1.7 KiB

11 years ago
  1. namespace Sevomin.Models.Migrations
  2. {
  3. using System.Data.Entity.Migrations;
  4. public partial class Paramvalues : DbMigration
  5. {
  6. public override void Up()
  7. {
  8. CreateTable(
  9. "dbo.Parameters",
  10. c => new
  11. {
  12. Id = c.Int(nullable: false, identity: true),
  13. Name = c.String(nullable: false),
  14. Moscow = c.Boolean(nullable: false),
  15. DisplayMethod = c.Byte(nullable: false),
  16. GroupName = c.String(nullable: false),
  17. CommentAvalin = c.String(maxLength: 140),
  18. CommentDovomin = c.String(maxLength: 140),
  19. ParameterValueId = c.String(maxLength: 50),
  20. })
  21. .PrimaryKey(t => t.Id)
  22. .Index(t=>t.ParameterValueId);
  23. CreateTable(
  24. "dbo.ParameterValues",
  25. c => new
  26. {
  27. GroupKey = c.String(nullable: false, maxLength: 50),
  28. Value = c.String(nullable: false, maxLength: 50),
  29. })
  30. .PrimaryKey(t => new { t.GroupKey, t.Value })
  31. .Index(t => t.GroupKey);
  32. }
  33. public override void Down()
  34. {
  35. DropForeignKey("dbo.ParameterValues", "Parameter_Id", "dbo.Parameters");
  36. DropIndex("dbo.ParameterValues", new[] { "Parameter_Id" });
  37. DropIndex("dbo.ParameterValues", new[] { "GroupKey" });
  38. DropTable("dbo.ParameterValues");
  39. DropTable("dbo.Parameters");
  40. }
  41. }
  42. }