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(type: "integer", nullable: false, comment: "Id скважины получателя"), id_well_src = table.Column(type: "integer", nullable: false, comment: "Id скважины композита"), id_well_section_type = table.Column(type: "integer", nullable: false, comment: "Id тип секции композита"), Id = table.Column(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"); } } }