feat(dal): создана связь между JobGroup & UnitField. Отключено каскадное удаление для этой связи
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addRel_JobGroup_UnitField : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Groups_GroupingUnitFieldId",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
column: "GroupingUnitFieldId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Groups_Fields_GroupingUnitFieldId",
|
||||
schema: "job",
|
||||
table: "Groups",
|
||||
column: "GroupingUnitFieldId",
|
||||
principalSchema: "unit",
|
||||
principalTable: "Fields",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Groups_Fields_GroupingUnitFieldId",
|
||||
schema: "job",
|
||||
table: "Groups");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Groups_GroupingUnitFieldId",
|
||||
schema: "job",
|
||||
table: "Groups");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user