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.

50 lines
2.2 KiB

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