|
|
- namespace Sevomin.Models.Migrations
- {
- using System;
- using System.Data.Entity.Migrations;
-
- public partial class Job : DbMigration
- {
- public override void Up()
- {
- DropForeignKey("dbo.ParameterValues", "Parameter_Id", "dbo.Parameters");
- DropIndex("dbo.ParameterValues", new[] { "Parameter_Id" });
- DropPrimaryKey("dbo.Parameters");
- CreateTable(
- "dbo.Jobs",
- c => new
- {
- Id = c.Long(nullable: false, identity: true),
- AvalinId = c.String(nullable: false, maxLength: 128),
- ExpireDate = c.DateTime(nullable: false),
- Description = c.String(),
- ResumeType = c.Byte(nullable: false),
- ContactPersonName = c.String(),
- ContactPersonPhone = c.String(),
- ContactPersonEMail = c.String(),
- ShowCompanyName = c.Boolean(nullable: false),
- ShowCompanyLogo = c.Boolean(nullable: false),
- IsFullTime = c.Boolean(nullable: false),
- })
- .PrimaryKey(t => t.Id)
- .ForeignKey("dbo.Avalin", t => t.AvalinId)
- .Index(t => t.AvalinId);
-
- AlterColumn("dbo.Parameters", "Id", c => c.Long(nullable: false, identity: true));
- AddPrimaryKey("dbo.Parameters", "Id");
- DropColumn("dbo.ParameterValues", "Parameter_Id");
- }
-
- public override void Down()
- {
- AddColumn("dbo.ParameterValues", "Parameter_Id", c => c.Int());
- DropForeignKey("dbo.Jobs", "AvalinId", "dbo.Avalin");
- DropIndex("dbo.Jobs", new[] { "AvalinId" });
- DropPrimaryKey("dbo.Parameters");
- AlterColumn("dbo.Parameters", "Id", c => c.Int(nullable: false, identity: true));
- DropTable("dbo.Jobs");
- AddPrimaryKey("dbo.Parameters", "Id");
- CreateIndex("dbo.ParameterValues", "Parameter_Id");
- AddForeignKey("dbo.ParameterValues", "Parameter_Id", "dbo.Parameters", "Id");
- }
- }
- }
|