Add migration Add_IX_FK_PlanOperation_to_WellOperation

This commit is contained in:
ngfrolov 2023-02-17 12:13:32 +05:00
parent 4750fe38d6
commit dcc3667e6a
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7
3 changed files with 7042 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Add_IX_FK_PlanOperation_to_WellOperation : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_t_well_operation_id_plan",
table: "t_well_operation",
column: "id_plan");
migrationBuilder.AddForeignKey(
name: "FK_t_well_operation_t_well_operation_id_plan",
table: "t_well_operation",
column: "id_plan",
principalTable: "t_well_operation",
principalColumn: "id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_t_well_operation_t_well_operation_id_plan",
table: "t_well_operation");
migrationBuilder.DropIndex(
name: "IX_t_well_operation_id_plan",
table: "t_well_operation");
}
}
}

View File

@ -4410,6 +4410,8 @@ namespace AsbCloudDb.Migrations
b.HasIndex("IdCategory");
b.HasIndex("IdPlan");
b.HasIndex("IdWell");
b.HasIndex("IdWellSectionType");
@ -6395,7 +6397,7 @@ namespace AsbCloudDb.Migrations
modelBuilder.Entity("AsbCloudDb.Model.ProcessMap", b =>
{
b.HasOne("AsbCloudDb.Model.Well", "Well")
.WithMany()
.WithMany("ProcessMaps")
.HasForeignKey("IdWell")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@ -6756,6 +6758,10 @@ namespace AsbCloudDb.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AsbCloudDb.Model.WellOperation", "OperationPlan")
.WithMany()
.HasForeignKey("IdPlan");
b.HasOne("AsbCloudDb.Model.Well", "Well")
.WithMany("WellOperations")
.HasForeignKey("IdWell")
@ -6770,6 +6776,8 @@ namespace AsbCloudDb.Migrations
b.Navigation("OperationCategory");
b.Navigation("OperationPlan");
b.Navigation("Well");
b.Navigation("WellSectionType");
@ -6958,6 +6966,8 @@ namespace AsbCloudDb.Migrations
{
b.Navigation("DrillingProgramParts");
b.Navigation("ProcessMaps");
b.Navigation("RelationCompaniesWells");
b.Navigation("WellCompositeSrcs");