DD.WellWorkover.Cloud/AsbCloudDb/Migrations/20211013123137_Add_Drill_Flow_Chart.cs
2021-10-13 17:34:32 +05:00

57 lines
3.8 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace AsbCloudDb.Migrations
{
public partial class Add_Drill_Flow_Chart : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "t_drill_flow_chart_params",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
well_id = table.Column<int>(type: "integer", nullable: false, comment: "Id скважины"),
last_update = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, comment: "Дата последнего изменения"),
depth_start = table.Column<double>(type: "double precision", nullable: false, comment: "Стартовая глубина"),
depth_end = table.Column<double>(type: "double precision", nullable: false, comment: "Глубина окончания интервала"),
axial_load_min = table.Column<double>(type: "double precision", nullable: false, comment: "Минимальная нагрузка"),
axial_load_max = table.Column<double>(type: "double precision", nullable: false, comment: "Максимальная нагрузка"),
pressure_min = table.Column<double>(type: "double precision", nullable: false, comment: "Минимальное давление"),
pressure_max = table.Column<double>(type: "double precision", nullable: false, comment: "Максимальное давление"),
rotor_torque_min = table.Column<double>(type: "double precision", nullable: false, comment: "Минимальный момент на ВСП"),
rotor_torque_max = table.Column<double>(type: "double precision", nullable: false, comment: "Максимальный момент на ВСП"),
rotor_speed_min = table.Column<double>(type: "double precision", nullable: false, comment: "Минимальные обороты на ВСП"),
rotor_speed_max = table.Column<double>(type: "double precision", nullable: false, comment: "Максимальные обороты на ВСП"),
flow_min = table.Column<double>(type: "double precision", nullable: false, comment: "Минимальный расход"),
flow_max = table.Column<double>(type: "double precision", nullable: false, comment: "Максимальный расход")
},
constraints: table =>
{
table.PrimaryKey("PK_t_drill_flow_chart_params", x => x.id);
table.ForeignKey(
name: "FK_t_drill_flow_chart_params_t_well_well_id",
column: x => x.well_id,
principalTable: "t_well",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
},
comment: "Параметры корридоров бурения (диапазоны параметров бурения)");
migrationBuilder.CreateIndex(
name: "IX_t_drill_flow_chart_params_well_id",
table: "t_drill_flow_chart_params",
column: "well_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "t_drill_flow_chart_params");
}
}
}