DD.WellWorkover.Cloud/AsbCloudDb/Migrations/20221202184302_WellOperationCategory_editDBmodel.cs
eugeniy_ivanov 6ed0dda96d migration
-edit default Data
-edit model
-update WellOperation
2022-12-03 00:48:40 +05:00

59 lines
2.0 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class WellOperationCategory_editDBmodel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "code",
table: "t_well_operation_category");
migrationBuilder.AddColumn<int>(
name: "id_parent",
table: "t_well_operation_category",
type: "integer",
nullable: true,
comment: "id родительской категории");
migrationBuilder.CreateIndex(
name: "IX_t_well_operation_category_id_parent",
table: "t_well_operation_category",
column: "id_parent");
migrationBuilder.AddForeignKey(
name: "FK_t_well_operation_category_t_well_operation_category_id_pare~",
table: "t_well_operation_category",
column: "id_parent",
principalTable: "t_well_operation_category",
principalColumn: "id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_t_well_operation_category_t_well_operation_category_id_pare~",
table: "t_well_operation_category");
migrationBuilder.DropIndex(
name: "IX_t_well_operation_category_id_parent",
table: "t_well_operation_category");
migrationBuilder.DropColumn(
name: "id_parent",
table: "t_well_operation_category");
migrationBuilder.AddColumn<int>(
name: "code",
table: "t_well_operation_category",
type: "integer",
nullable: false,
defaultValue: 0,
comment: "Код операции");
}
}
}