using Microsoft.EntityFrameworkCore.Migrations; namespace AsbCloudDb.Migrations { public partial class Rename_DrillFlowChartParams_to_DrillFlowChart : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_t_drill_flow_chart_params_t_well_well_id", table: "t_drill_flow_chart_params"); migrationBuilder.DropPrimaryKey( name: "PK_t_drill_flow_chart_params", table: "t_drill_flow_chart_params"); migrationBuilder.RenameTable( name: "t_drill_flow_chart_params", newName: "t_drill_flow_chart"); migrationBuilder.RenameIndex( name: "IX_t_drill_flow_chart_params_well_id", table: "t_drill_flow_chart", newName: "IX_t_drill_flow_chart_well_id"); migrationBuilder.AddPrimaryKey( name: "PK_t_drill_flow_chart", table: "t_drill_flow_chart", column: "id"); migrationBuilder.AddForeignKey( name: "FK_t_drill_flow_chart_t_well_well_id", table: "t_drill_flow_chart", column: "well_id", principalTable: "t_well", principalColumn: "id", onDelete: ReferentialAction.Cascade); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_t_drill_flow_chart_t_well_well_id", table: "t_drill_flow_chart"); migrationBuilder.DropPrimaryKey( name: "PK_t_drill_flow_chart", table: "t_drill_flow_chart"); migrationBuilder.RenameTable( name: "t_drill_flow_chart", newName: "t_drill_flow_chart_params"); migrationBuilder.RenameIndex( name: "IX_t_drill_flow_chart_well_id", table: "t_drill_flow_chart_params", newName: "IX_t_drill_flow_chart_params_well_id"); migrationBuilder.AddPrimaryKey( name: "PK_t_drill_flow_chart_params", table: "t_drill_flow_chart_params", column: "id"); migrationBuilder.AddForeignKey( name: "FK_t_drill_flow_chart_params_t_well_well_id", table: "t_drill_flow_chart_params", column: "well_id", principalTable: "t_well", principalColumn: "id", onDelete: ReferentialAction.Cascade); } } }