DD.WellWorkover.Cloud/AsbCloudDb/Migrations/20231127114017_Update_t_planned_trajectory.cs

110 lines
3.9 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Update_t_planned_trajectory : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_t_planned_trajectory_t_user_id_user",
table: "t_planned_trajectory");
migrationBuilder.DropForeignKey(
name: "FK_t_planned_trajectory_t_well_id_well",
table: "t_planned_trajectory");
migrationBuilder.DropPrimaryKey(
name: "PK_t_planned_trajectory",
table: "t_planned_trajectory");
migrationBuilder.RenameTable(
name: "t_planned_trajectory",
newName: "t_trajectory_planned");
migrationBuilder.RenameIndex(
name: "IX_t_planned_trajectory_id_well",
table: "t_trajectory_planned",
newName: "IX_t_trajectory_planned_id_well");
migrationBuilder.RenameIndex(
name: "IX_t_planned_trajectory_id_user",
table: "t_trajectory_planned",
newName: "IX_t_trajectory_planned_id_user");
migrationBuilder.AddPrimaryKey(
name: "PK_t_trajectory_planned",
table: "t_trajectory_planned",
column: "id");
migrationBuilder.AddForeignKey(
name: "FK_t_trajectory_planned_t_user_id_user",
table: "t_trajectory_planned",
column: "id_user",
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_t_trajectory_planned_t_well_id_well",
table: "t_trajectory_planned",
column: "id_well",
principalTable: "t_well",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_t_trajectory_planned_t_user_id_user",
table: "t_trajectory_planned");
migrationBuilder.DropForeignKey(
name: "FK_t_trajectory_planned_t_well_id_well",
table: "t_trajectory_planned");
migrationBuilder.DropPrimaryKey(
name: "PK_t_trajectory_planned",
table: "t_trajectory_planned");
migrationBuilder.RenameTable(
name: "t_trajectory_planned",
newName: "t_planned_trajectory");
migrationBuilder.RenameIndex(
name: "IX_t_trajectory_planned_id_well",
table: "t_planned_trajectory",
newName: "IX_t_planned_trajectory_id_well");
migrationBuilder.RenameIndex(
name: "IX_t_trajectory_planned_id_user",
table: "t_planned_trajectory",
newName: "IX_t_planned_trajectory_id_user");
migrationBuilder.AddPrimaryKey(
name: "PK_t_planned_trajectory",
table: "t_planned_trajectory",
column: "id");
migrationBuilder.AddForeignKey(
name: "FK_t_planned_trajectory_t_user_id_user",
table: "t_planned_trajectory",
column: "id_user",
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_t_planned_trajectory_t_well_id_well",
table: "t_planned_trajectory",
column: "id_well",
principalTable: "t_well",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
}
}