using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace AsbCloudDb.Migrations
{
    public partial class AddTable_t_process_map : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "t_process_map",
                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 скважины"),
                    section = table.Column<int>(type: "integer", nullable: false, comment: "Секция"),
                    last_update = table.Column<DateTimeOffset>(type: "timestamp with 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_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Нагрузка, план"),
                    axial_load_fact = table.Column<double>(type: "double precision", nullable: true, comment: "Нагрузка, факт"),
                    pressure_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Перепад давления, план"),
                    pressure_fact = table.Column<double>(type: "double precision", nullable: true, comment: "Перепад давления, факт"),
                    rotor_torque_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Момент на ВСП, план"),
                    rotor_torque_fact = table.Column<double>(type: "double precision", nullable: true, comment: "Момент на ВСП, факт"),
                    rotor_speed_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Обороты на ВСП, план"),
                    rotor_speed_fact = table.Column<double>(type: "double precision", nullable: true, comment: "Обороты на ВСП, факт"),
                    flow_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Расход, план"),
                    flow_fact = table.Column<double>(type: "double precision", nullable: true, comment: "Расход, факт"),
                    mechanical_speed_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Плановая механическая скорость, м/ч")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_process_map", x => x.id);
                },
                comment: "Операции по скважине – РТК");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "t_process_map");
        }
    }
}