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.

47 lines
1.7 KiB

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