1
0
mirror of https://github.com/chyzy/RSystem-MVC synced 2024-11-29 17:00:28 +01:00
RSystem-MVC-Fork/RSystem/Migrations/201801222210319_PrepareDbModelsForRecrutation.cs

25 lines
1.0 KiB
C#
Raw Normal View History

2018-04-17 11:20:49 +02:00
namespace RSystem.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class PrepareDbModelsForRecrutation : DbMigration
{
public override void Up()
{
AddColumn("dbo.Specializations", "LimitOfPlaces", c => c.Int(nullable: false));
AddColumn("dbo.Recruits", "AcceptedSpecialization_SpecializationId", c => c.Int());
CreateIndex("dbo.Recruits", "AcceptedSpecialization_SpecializationId");
AddForeignKey("dbo.Recruits", "AcceptedSpecialization_SpecializationId", "dbo.Specializations", "SpecializationId");
}
public override void Down()
{
DropForeignKey("dbo.Recruits", "AcceptedSpecialization_SpecializationId", "dbo.Specializations");
DropIndex("dbo.Recruits", new[] { "AcceptedSpecialization_SpecializationId" });
DropColumn("dbo.Recruits", "AcceptedSpecialization_SpecializationId");
DropColumn("dbo.Specializations", "LimitOfPlaces");
}
}
}