mirror of
https://github.com/chyzy/RSystem-MVC
synced 2024-08-25 04:06:57 +02: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");
|
|
}
|
|
}
|
|
}
|