using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace AsbCloudDb.Migrations { public partial class Rename_WITS_base_table : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_1_RecordBase_id_telemetry_date", table: "t_telemetry_wits_1"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_50_RecordBase_id_telemetry_date", table: "t_telemetry_wits_50"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_60_RecordBase_id_telemetry_date", table: "t_telemetry_wits_60"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_61_RecordBase_id_telemetry_date", table: "t_telemetry_wits_61"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_7_RecordBase_id_telemetry_date", table: "t_telemetry_wits_7"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_8_RecordBase_id_telemetry_date", table: "t_telemetry_wits_8"); migrationBuilder.DropPrimaryKey( name: "PK_RecordBase", table: "RecordBase"); migrationBuilder.RenameTable( name: "RecordBase", newName: "t_telemetry_wits_base"); migrationBuilder.AddPrimaryKey( name: "PK_t_telemetry_wits_base", table: "t_telemetry_wits_base", columns: new[] { "id_telemetry", "date" }); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_1_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_1", columns: new[] { "id_telemetry", "date" }, principalTable: "t_telemetry_wits_base", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_50_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_50", columns: new[] { "id_telemetry", "date" }, principalTable: "t_telemetry_wits_base", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_60_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_60", columns: new[] { "id_telemetry", "date" }, principalTable: "t_telemetry_wits_base", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_61_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_61", columns: new[] { "id_telemetry", "date" }, principalTable: "t_telemetry_wits_base", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_7_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_7", columns: new[] { "id_telemetry", "date" }, principalTable: "t_telemetry_wits_base", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_8_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_8", columns: new[] { "id_telemetry", "date" }, principalTable: "t_telemetry_wits_base", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_1_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_1"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_50_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_50"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_60_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_60"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_61_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_61"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_7_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_7"); migrationBuilder.DropForeignKey( name: "FK_t_telemetry_wits_8_t_telemetry_wits_base_id_telemetry_date", table: "t_telemetry_wits_8"); migrationBuilder.DropPrimaryKey( name: "PK_t_telemetry_wits_base", table: "t_telemetry_wits_base"); migrationBuilder.RenameTable( name: "t_telemetry_wits_base", newName: "RecordBase"); migrationBuilder.AddPrimaryKey( name: "PK_RecordBase", table: "RecordBase", columns: new[] { "id_telemetry", "date" }); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_1_RecordBase_id_telemetry_date", table: "t_telemetry_wits_1", columns: new[] { "id_telemetry", "date" }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_50_RecordBase_id_telemetry_date", table: "t_telemetry_wits_50", columns: new[] { "id_telemetry", "date" }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_60_RecordBase_id_telemetry_date", table: "t_telemetry_wits_60", columns: new[] { "id_telemetry", "date" }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_61_RecordBase_id_telemetry_date", table: "t_telemetry_wits_61", columns: new[] { "id_telemetry", "date" }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_7_RecordBase_id_telemetry_date", table: "t_telemetry_wits_7", columns: new[] { "id_telemetry", "date" }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_t_telemetry_wits_8_RecordBase_id_telemetry_date", table: "t_telemetry_wits_8", columns: new[] { "id_telemetry", "date" }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); } } }