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.

51 lines
2.2 KiB

11 years ago
  1. namespace Sevomin.Models.Migrations
  2. {
  3. using System;
  4. using System.Data.Entity.Migrations;
  5. public partial class Job : DbMigration
  6. {
  7. public override void Up()
  8. {
  9. DropForeignKey("dbo.ParameterValues", "Parameter_Id", "dbo.Parameters");
  10. DropIndex("dbo.ParameterValues", new[] { "Parameter_Id" });
  11. DropPrimaryKey("dbo.Parameters");
  12. CreateTable(
  13. "dbo.Jobs",
  14. c => new
  15. {
  16. Id = c.Long(nullable: false, identity: true),
  17. AvalinId = c.String(nullable: false, maxLength: 128),
  18. ExpireDate = c.DateTime(nullable: false),
  19. Description = c.String(),
  20. ResumeType = c.Byte(nullable: false),
  21. ContactPersonName = c.String(),
  22. ContactPersonPhone = c.String(),
  23. ContactPersonEMail = c.String(),
  24. ShowCompanyName = c.Boolean(nullable: false),
  25. ShowCompanyLogo = c.Boolean(nullable: false),
  26. IsFullTime = c.Boolean(nullable: false),
  27. })
  28. .PrimaryKey(t => t.Id)
  29. .ForeignKey("dbo.Avalin", t => t.AvalinId)
  30. .Index(t => t.AvalinId);
  31. AlterColumn("dbo.Parameters", "Id", c => c.Long(nullable: false, identity: true));
  32. AddPrimaryKey("dbo.Parameters", "Id");
  33. DropColumn("dbo.ParameterValues", "Parameter_Id");
  34. }
  35. public override void Down()
  36. {
  37. AddColumn("dbo.ParameterValues", "Parameter_Id", c => c.Int());
  38. DropForeignKey("dbo.Jobs", "AvalinId", "dbo.Avalin");
  39. DropIndex("dbo.Jobs", new[] { "AvalinId" });
  40. DropPrimaryKey("dbo.Parameters");
  41. AlterColumn("dbo.Parameters", "Id", c => c.Int(nullable: false, identity: true));
  42. DropTable("dbo.Jobs");
  43. AddPrimaryKey("dbo.Parameters", "Id");
  44. CreateIndex("dbo.ParameterValues", "Parameter_Id");
  45. AddForeignKey("dbo.ParameterValues", "Parameter_Id", "dbo.Parameters", "Id");
  46. }
  47. }
  48. }