|
|
@ -0,0 +1,42 @@ |
|
|
|
namespace Sevomin.Models.Migrations |
|
|
|
{ |
|
|
|
using System; |
|
|
|
using System.Data.Entity.Migrations; |
|
|
|
|
|
|
|
public partial class DovominJob : DbMigration |
|
|
|
{ |
|
|
|
public override void Up() |
|
|
|
{ |
|
|
|
CreateTable( |
|
|
|
"dbo.DovominJobs", |
|
|
|
c => new |
|
|
|
{ |
|
|
|
Id = c.Long(nullable: false, identity: true), |
|
|
|
DovominId = c.String(nullable: false, maxLength: 128), |
|
|
|
JobId = c.Long(nullable: false), |
|
|
|
ApplyDate = c.DateTime(nullable: false), |
|
|
|
CoverLetter = c.String(nullable: false), |
|
|
|
Affinity = c.Decimal(nullable: false, precision: 18, scale: 2), |
|
|
|
MinimumRequirement = c.Boolean(nullable: false), |
|
|
|
AvalinSeen = c.DateTime(), |
|
|
|
AvalinComment = c.String(), |
|
|
|
AvalinDelete = c.Boolean(nullable: false), |
|
|
|
}) |
|
|
|
.PrimaryKey(t => t.Id) |
|
|
|
.ForeignKey("dbo.Dovomin", t => t.DovominId) |
|
|
|
.ForeignKey("dbo.Jobs", t => t.JobId, cascadeDelete: true) |
|
|
|
.Index(t => new { t.DovominId, t.JobId }, unique: true, name: "IX_DovominJobUniqueIndex") |
|
|
|
.Index(t => t.JobId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override void Down() |
|
|
|
{ |
|
|
|
DropForeignKey("dbo.DovominJobs", "JobId", "dbo.Jobs"); |
|
|
|
DropForeignKey("dbo.DovominJobs", "DovominId", "dbo.Dovomin"); |
|
|
|
DropIndex("dbo.DovominJobs", new[] { "JobId" }); |
|
|
|
DropIndex("dbo.DovominJobs", "IX_DovominJobUniqueIndex"); |
|
|
|
DropTable("dbo.DovominJobs"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |