DD.WellWorkover.Cloud/AsbCloudDb/Migrations/20211012043133_Add_CompositeWell.cs
2021-10-12 10:39:42 +05:00

55 lines
2.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.EntityFrameworkCore.Migrations;
namespace AsbCloudDb.Migrations
{
public partial class Add_CompositeWell : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "t_сomposite_well",
columns: table => new
{
id_well = table.Column<int>(type: "integer", nullable: false, comment: "Id скважины получателя"),
id_well_src = table.Column<int>(type: "integer", nullable: false, comment: "Id скважины композита"),
id_well_section_type = table.Column<int>(type: "integer", nullable: false, comment: "Id тип секции композита"),
Id = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_t_сomposite_well", x => new { x.id_well, x.id_well_src, x.id_well_section_type });
table.ForeignKey(
name: "t_сomposite_well_src_t_well_id_fk",
column: x => x.id_well_src,
principalTable: "t_well",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "t_сomposite_well_t_well_id_fk",
column: x => x.id_well,
principalTable: "t_well",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "t_сomposite_well_t_well_section_type_id_fk",
column: x => x.id_well_src,
principalTable: "t_well_section_type",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
},
comment: "Композитная скважина");
migrationBuilder.CreateIndex(
name: "IX_t_сomposite_well_id_well_src",
table: "t_сomposite_well",
column: "id_well_src");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "t_сomposite_well");
}
}
}