DD.WellWorkover.Cloud/AsbCloudDb/Migrations/20211014082358_Fix_WellComposite_FK.cs

47 lines
1.7 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore.Migrations;
namespace AsbCloudDb.Migrations
{
public partial class Fix_WellComposite_FK : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "t_well_сomposite_t_well_section_type_id_fk",
table: "t_well_сomposite");
migrationBuilder.CreateIndex(
name: "IX_t_well_сomposite_id_well_section_type",
table: "t_well_сomposite",
column: "id_well_section_type");
migrationBuilder.AddForeignKey(
name: "t_well_сomposite_t_well_section_type_id_fk",
table: "t_well_сomposite",
column: "id_well_section_type",
principalTable: "t_well_section_type",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "t_well_сomposite_t_well_section_type_id_fk",
table: "t_well_сomposite");
migrationBuilder.DropIndex(
name: "IX_t_well_сomposite_id_well_section_type",
table: "t_well_сomposite");
migrationBuilder.AddForeignKey(
name: "t_well_сomposite_t_well_section_type_id_fk",
table: "t_well_сomposite",
column: "id_well_src",
principalTable: "t_well_section_type",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
}
}