mirror of
https://github.com/chyzy/RSystem-MVC
synced 2024-11-03 19:05:26 +01:00
25 lines
1.0 KiB
C#
25 lines
1.0 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|